trailblazer / cells

View components for Ruby and Rails.
https://trailblazer.to/2.1/docs/cells.html
3.07k stars 236 forks source link

Problem with form_for in 4.0.0beta2 #276

Closed samstickland closed 9 years ago

samstickland commented 9 years ago

Calling this in my show.erb:

<%= form_for(form_objects) do |f| %>

give the following error:

SyntaxError (app/cells/work_history_form/show.erb:1: syntax error, unexpected ')'
 _erbout << ( form_for(form_objects) do |f| ).to_s; _erbout << '
                                             ^
app/cells/work_history_form/show.erb:40: syntax error, unexpected keyword_ensure, expecting ')'
app/cells/work_history_form/show.erb:42: syntax error, unexpected keyword_end, expecting ')'):
  app/cells/work_history_form/show.erb:1: syntax error, unexpected ')'
  app/cells/work_history_form/show.erb:40: syntax error, unexpected keyword_ensure, expecting ')'
  app/cells/work_history_form/show.erb:42: syntax error, unexpected keyword_end, expecting ')'
  app/cells/work_history_form_cell.rb:17:in `show'
  app/controllers/work_histories_controller.rb:85:in `new'

Calling it like this:

<% form_for(form_objects) do |f| %>

Doesn't give errors, but obviously doesn't produce any form tags either.

samstickland commented 9 years ago

I've just tried this with cells-erb installed and I still have the same issue. Odd, because it says in the source-code comments for cells-erb that it's purpose is to fix precisely this problem!

apotonick commented 9 years ago

This is fixed in cells-erb 0.0.2. Please use cells-erb/master until @seuros gives me push rights.