My form seems to work perfectly fine locally, but gives me a syntax error on heroku. Here is my code thats causing the error:
<%= form_for (@item, {:url => [@company, @item]}) do |item_form| %>
The error is:
syntax error, unexpected ‘}’, expecting keyword_end
2011-09-24T22:25:25+00:00 app[web.1]: …e, {:url => [@company, @item]}) do |item_form| @output_buf…
Then when I tried
<%= form_for (@item, :url => [@company, @item]) do |item_form| %>
It gave me this error:
syntax error, unexpected ‘,’, expecting ‘)’
2011-09-24T22:18:01+00:00 app[web.1]: …ffer.append= form_for (@share, :url => [@company, @share])
Any ideas?
You should remove the space between the method call
form_forand the opening parenthesis(. As a general rule, never do this. It’s ambiguous and may result in the parser thinking that you’re callingform_forwith one argument, like this:… which would be a syntax error, resulting in the errors you’re seeing (e.g. unexpected comma)