how to add html id to rails form_tag

前端 未结 4 1154
北荒
北荒 2021-01-31 13:36

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         


        
4条回答
  •  醉酒成梦
    2021-01-31 13:45

    This code

    form_tag(:controller => "people", :action => "search", :method => "get", :class => "nifty_form")
    

    give as result:

    But, if you use this structure

    form_tag({:controller => "people", :action => "search"}, :method => "get", :class => "nifty_form")
    

    you will get as result

    
    

    and it's exactly what you want

提交回复
热议问题