Twitter Bootstrap for Rails 3

Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more

Step-1

Add gems inside asset group in your Gemfile

group :assets do
    gem ‘therubyracer’, ‘0.10.2’, :platforms => :ruby
    gem ‘libv8’, ‘3.3.10.4’
    gem ‘less-rails’

    gem ‘twitter-bootstrap-rails’
end

Step-2

bundle install

Step-3

rails generate bootstrap:install less

Step – 4

Generating layouts and views

rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid]

example
rails g bootstrap:layout application fluid

Step-5

To add theme in all files of a resource (generates Twitter Bootstrap compatible scaffold views.)

rails g bootstrap:themed [RESOURCE_NAME]

 

Example:

rails g scaffold Post title:string description:text
rake db:migrate
rails g bootstrap:themed Posts