how to add html id to rails form_tag

前端 未结 4 1150
北荒
北荒 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

    In my case I needed to put HTML options in {} to actually add id to form_tag, like this:

    <%= form_tag(some_update_path(@some_record), { method: :put, id: "some-id" }) do <% end %>

提交回复
热议问题