I am using Rails 2.2.2 and I would like to add an id to the html form code generated by the form_tag.
<% form_tag session_path do -%> <% end -%>
Currently produces:
<form action='/session' method='post'> </form>
Would like it to produce:
<form id='login_form' action='/session' method='post'> </form>
The api isn’t really any help and I’ve tried adding various combinations of
:html => {:id => 'login_form'}
with no luck.
For
<element>_tagyou specify HTML attributes directly, as follows:It is for
<element>_remote_tagconstructs that you need to move the HTML attributes inside a:htmlmap: