Login

Sass'd Bootstrap Even Better


Posted: Nov 14, 2011 Tagged: asset pipelineRails

A while back I wrote a post on how to use the Sass version of Twitter's Bootstrap toolkit in your Rails 3.1 app. You had to clone a repo and copy a bunch of files over, blah, blah, blah. That's so last week.

Now there's a new, much better way to include all the Sass and Bootstrap goodness. Here's how it works:

1) Add the bootstrap-sass gem from Thomas McDonald to your Gemfile like so

gem 'bootstrap-sass'

2) Update your bundle

3) Add this line to your application.css

*= require bootstrap

4) High-five yourself

That's all it takes and you're up and running with the Bootstrap styles. What's that you say? You want the Bootstrap JS libraries also? No problem. Just add them to your application.js like this

//= require bootstrap

Or if you want to pick and choose which JS to include, like this

//= require bootstrap-scrollspy
//= require bootstrap-modal
//= require bootstrap-dropdown

Very nice.

 
Fork me on GitHub