如何在rails中更改提交按钮的html

时间:2012-12-08 07:34:54

标签: ruby-on-rails ruby-on-rails-3

如果我提交表格,那么我写&lt;%f.submit%&gt;它就像<input id="subscriptions" name="commit" type="submit" value="Save">一样,但我希望这个<button class="btn submit" type="button">SUBMIT</button>。我怎么能这样做?

2 个答案:

答案 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 %>