Twitter Bootstrap - Helpers

Installation

Add to your gem file and call bundle to install it.

gem twitter_bootstrap-helpers install

Adding to rails

gem 'twitter_bootstrap-helpers'

Usage

Basic usage with form helper

<%= bootstrap_form_for @post do |f| %>
    <%= f.text_field_control :title %>
    <%= f.text_area_control :body %>
    <%= f.checkbox_control :published %>
    <%= f.form_actions %>
<% end %>

To use form builder directly

<%= form_for @post, builder: TwitterBootstrap::Helpers::FormBuilder,
                    html:{class: 'form-horizontal'} do |f| %>
    <%= f.text_field_control :title %>
    <%= f.text_area_control :body %>
    <%= f.checkbox_control :published %>
    <%= f.form_actions %>
<% end %>