Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在将 id="signup" 添加到我的表单时遇到问题:我尝试过但它不起作用。
<%= form_for @admin, :id => "signup" do |f| %>
它不工作。如何将 html id 添加到 rails 中的 form_for 标签?
您需要在rails中的html下添加它
<%= form_for @admin, :html => { :id => "signup" } do |f| %>
尝试这个
<%= form_for @admin, :html => {:id => 'signup'} do |f|%>