I need use button_tag instead submit_tag on a form to add icon with style http://twitter.github.com/bootstrap/base-css.html#buttons.
<%= simple_form_for(bla..........bla......)) do %>
<%= button_tag t('.sent_to_trash'), :class => "btn btn-small btn-primary disabled", :id => "trash_button", do %>
<i class="icon-trash icon-white"></i>
<%= t('.sent_to_trash') %>
<% end %>
<% end %>
The question is I can not receive the params[:commit] with button_tag, however with submit_tag is working fine and I receive correctly params[:commit] on my action controller.
How can I fix this problem?
Thank you very much!
Html element
buttonworks with:nameand:valueparams, so you have to explicitly define these, e.g.then you get
params[:commit] = "my_button"after form submit.Note: You should specify
:typeattribute too, because different browsers use different default types for the<button>element (:type => "submit")