Monday, February 25, 2013

How to Install Twitter Bootstrap in Rails

To install Twitter Bootstrap in a Rails application, there are several ways and gems. Here I prefer the working and straight-forward one.

1- Inside "group :assets" add:
gem 'bootstrap-sass'

2- Go to "app\assets\stylesheets" directory and create a file named "bootstrap_and_overrides.css.scss"

3- Inside the previous file, add:
@import "bootstrap";
@import "bootstrap-responsive";

4- Inside "app\assets\javascripts\application.js" file, add:
//= require bootstrap

5- Then in the terminal, do "bundle install" and your Rails application with be ready for Twitter Bootstrap tags.


No comments:

Post a Comment