I had a working Rails site which I did not touch for some time. I am now opening it in Rails 3.1.0 and Ruby 1.9.2p290.
I have this syntax in my view:
<%= form_tag ("save", :method=>"get", :id=>"save") do %>
I now get this Rails error when it process the view:
syntax error, unexpected keyword_ensure, expecting $end):
I have read that I should use this instead, but I am not sure why:
<%= form_tag :action=>"save", :method=>"get", :id=>"save" do %>
This does render something to the user but it renders a form without an “id” attribute like before; it should be “save“. I found many links suggesting to put the parameters in {...} or do other stuff, but the id is never generated.
Remove the space character after the
form_tagto make it: