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 -%&g
For
you specify HTML attributes directly, as follows:
<% form_tag session_path, :id => 'elm_id', :class => 'elm_class',
:style => 'elm_style' do -%>
...
<% end -%>
It is for remote
_tag
constructs that you need to move the HTML attributes inside a :html
map:
<% form_tag form_remote_tag :url => session_path, :html => {
:id => 'elm_id', :class => 'elm_class',
:style => 'elm_style' } do -%>
...
<% end -%>