伙计们我可以为我的 rails表单设置特殊名称 ??
我尝试使用此命令,但总是失败
<%= form_for(@contact,:name =>"FormContact", :remote => true) do |f| %>
OR
<%= form_for(:FormContact,@contact, :remote => true) do |f| %>
OR
<%= form_for(@contact,name: "FormContact", :remote => true) do |f| %>
答案 0 :(得分:1)
尝试:
<%= form_for(@contact, html: { name: "FormContact" }, remote: true) do |f| %>
...
<% end %>
参考:http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html
希望有所帮助:)