A short note on how to add the Sass version of Bootstrap to a Rails app.
Step 1. Add the bootstrap sass Gem
Add the bootstrap-sass gem to the Gemfile
gem 'bootstrap-sass', '22.214.171.124'
Step 2. Install with bundle install
$ bundle install
Step 3. Add sass to the the asset pipeline
Configure Rails to precompile SASS stylesheets as part of the asset pipeline in config/aplication.rb
require File.expand_path('../boot', __FILE__) . module SampleApp class Application < Rails::Application . config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) end end
Note: any files with app/assets/stylesheets will be automatically compiled into application.css
Step 4. Add the Bootstrap framework to the applications CSS.
Create a custom.css.scss file in app/assets/stylesheets and import bootstrap
Note: The file extension is used to tell Rails which precompiler to use. e.g. customer.css.scss tells Rails that this file is a Sass file (.scss) and it should be precompiled into CSS. In the case of CSS, if this file is in the app/assets/stylesheets directory , it will also be included into the application.css file which is ultimately sent to the browser.
For a proper introduction to rails, see http://ruby.railstutorial.org/