I have this syntax which works (since it’s from the API, pretty much)
<% form_tag :action => 'whatever' do -%> <div><%= submit_tag 'Save' %></div> <% end -%>
and this, which works
<%= form_tag({:action => 'whatever'}, {:method => 'get'})%>
Now I have tried to combine them, guessing the syntax. The ‘get’ does not get added as the form method as I had hoped. How should this read?
<% form_tag :action => 'whatever',:method => 'get' do -%> <div><%= submit_tag 'Save' %></div> <% end -%>
Form tag should read:
<form action='hello/whatever' method='get'/>
not
<form action='hello/whatever?method=get' />
Looking at the API docs, the issue is that
:methodneeds to go in theoptionshash, and the:actionin theurl_for_optionshash, and you need the extra curly brackets so the interpreter knows they are different hashes.