Button helpers wraps a button or link with bootstrap style.

Buttons with url

<%= btn('I am a button.', js: 'alert("show")', type: 'button') %> <%= btn('I am a link.', js: 'alert("show")') %> <%= btn('I am a link with an icon.', js: 'alert("show")', icon: 'plus') %> <%= btn('I am a link with an url.', controller: 'components', action: 'index', icon: 'plus', class: 'primary') %> <%= btn('I am a button with an url.', controller: 'components', action: 'index', icon: 'plus', class: 'primary', type: 'button') %>

<%= btn('I am a large block link with an icon.', url: '#button', icon: 'plus', size: 'large', block: true) %>
<%= btn('I am a button.', js: 'alert("show")', type: 'button') %>
<%= btn('I am a link.', js: 'alert("show")') %>
<%= btn('I am a link with an icon.', js: 'alert("show")', icon: 'plus') %>
<%= btn('I am a link with an url.', controller: 'components', action: 'index', icon: 'plus', class: 'primary') %>
<%= btn('I am a button with an url.', controller: 'components', action: 'index', icon: 'plus', class: 'primary', type: 'button') %>
<%= btn('I am a large block link with an icon.', url: '#button', icon: 'plus', size: 'large', block: true) %>

Submit button

<%= form_tag '/components/update' do %> <%= btn('I am a submit.', type: 'submit') %> <%= btn('I am a submit.', type: 'submit', icon: 'plus', confirm: 'are you sure?', disable_with: 'go go go') %> <% end %> <%= form_tag '#', data: {readonly: true} do %> <%= btn('You can not submit.', type: 'submit') %> <%= btn('You can not submit.', type: 'submit', icon: 'plus', confirm: 'are you sure?', disable_with: 'go go go') %> <% end %>
<%= btn('I am a submit.', type: 'submit') %>
<%= btn('I am a submit.', type: 'submit', icon: 'plus', confirm: 'are you sure?', disable_with: 'go go go') %>

<%= form_tag '#', data: {readonly: true} do %>
  <%= btn('You can not submit.', type: 'submit') %>
  <%= btn('You can not submit.', type: 'submit', icon: 'plus', confirm: 'are you sure?', disable_with: 'go go go') %>
<% end %>

Button group

<%= bg do %> <%= btn('I am 1st button.', url: '#button') %> <%= btn('I am 2nd button.', url: '#button') %> <%= btn('I am 3rd button.', url: '#button') %> <% end %>
<%= bg do %>
    <%= btn('I am 1st button.', url: '#button') %>
    <%= btn('I am 2nd button.', url: '#button') %>
    <%= btn('I am 3rd button.', url: '#button') %>
<% end %>

Button toolbar

<%= bt do %> <%= bg do %> <%= btn('1', url: '#button') %> <%= btn('2', url: '#button') %> <%= btn('3', url: '#button') %> <% end %> <%= bg do %> <%= btn('4', url: '#button') %> <%= btn('5', url: '#button') %> <% end %> <%= bg do %> <%= btn('6', url: '#button') %> <%= btn('7', url: '#button') %> <%= btn('8', url: '#button') %> <% end %> <% end %>
<%= bt do %>
  <%= bg do %>
    <%= btn('1', url: '#button') %>
    <%= btn('2', url: '#button') %>
    <%= btn('3', url: '#button') %>
  <% end %>

  <%= bg do %>
    <%= btn('4', url: '#button') %>
    <%= btn('5', url: '#button') %>
  <% end %>

  <%= bg do %>
    <%= btn('6', url: '#button') %>
    <%= btn('7', url: '#button') %>
    <%= btn('8', url: '#button') %>
  <% end %>
<% end %>

Button checkbox

<%= bg(data: {toggle: 'buttons-checkbox'}) do %> <%= btn('I am 1st button.', {url: '#button'}, class: 'active') %> <%= btn('I am 2nd button.', url: '#button') %> <%= btn('I am 3rd button.', {url: '#button'}, class: 'active') %> <% end %>
<%= bg(data: {toggle: 'buttons-checkbox'}) do %>
    <%= btn('I am 1st button.', {url: '#button'}, class: 'active') %>
    <%= btn('I am 2nd button.', url: '#button') %>
    <%= btn('I am 3rd button.', {url: '#button'}, class: 'active')) %>
<% end %>

Button radio

<%= bg(data: {toggle: 'buttons-radio'}) do %> <%= btn('I am 1st button.', {url: '#button'}, class: 'active') %> <%= btn('I am 2nd button.', url: '#button') %> <%= btn('I am 3rd button.', url: '#button') %> <% end %>
<%= bg(data: {toggle: 'buttons-radio'}) do %>
    <%= btn('I am 1st button.', {url: '#button'}, class: 'active') %>
    <%= btn('I am 2nd button.', url: '#button') %>
    <%= btn('I am 3rd button.', url: '#button') %>
<% end %>