如果我提交表格,那么我写&lt;%f.submit%&gt;它就像<input id="subscriptions" name="commit" type="submit" value="Save">
一样,但我希望这个<button class="btn submit" type="button">SUBMIT</button>
。我怎么能这样做?
答案 0 :(得分:2)
试试这个:
<%= f.submit id: nil, name: nil, value: nil, class: "btn submit" %>
答案 1 :(得分:2)
参考this
<% content_tag :button :type => :submit, :class => "btn submit" do %>
<% end %>