Change html form id generated by form_for rails 3.1

前端 未结 3 935
心在旅途
心在旅途 2021-02-06 21:41

I have this form_for:

<%= form_for [post, Comment.new,], :remote => true do |f| %>
<%= f.text_area :content, :cols =>10, :rows => 1%>
<%          


        
3条回答
  •  [愿得一人]
    2021-02-06 22:35

    You should be able to set the form's id to whatever you want. Something like:

    <%= form_for @object, :html=> {:id => 'custom_form_id'} do |f| %>
    

提交回复
热议问题