Skip to content

Instantly share code, notes, and snippets.

@jhadeepakkumar14
Last active May 27, 2017 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhadeepakkumar14/ee9e953f010be24b7247c6b5c3a8beb2 to your computer and use it in GitHub Desktop.
Save jhadeepakkumar14/ee9e953f010be24b7247c6b5c3a8beb2 to your computer and use it in GitHub Desktop.
How to add Bootstrap in Ruby on Rails App
1. Add following gems in Gemfile
gem 'bootstrap-sass', '~>3.3.6'
gem 'autoprefixer-rails', '~>7.1.1'
2. Run bundle install
3. Add one file custom.css.scss file under app/assets/stylesheets with following contents,
@import 'bootstrap-sprockets';
@import 'bootstrap'
4. Add bootstrap-sprockets after jquery_ujs in application.js under app/assets/javascripts,
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
Enjoy bootstrap!
Note: Tested in rails 5 please check gem version before using for Rails 3 and Rails 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment