I use twitter-boostrap and I\'d like to use these radio-buttons in my form. The problem is when I click on any of these buttons, the form is immediately submitted. How to av
You can do this directly using rails form helper also by specifying type as an option to "button":
<%= form_for @product do |f| %>
<%= f.label :type, :class => 'control-label' %>
<%= f.button "Button_1", type: "button", class: "btn" %>
<%= f.button "Button_2", type: "button", class: "btn" %>
<%= f.submit nil, :class => 'btn btn-primary' %>
<%= link_to 'Cancel', products_path, :class => 'btn' %>
<% end %>