Last active
May 27, 2017 04:34
-
-
Save jhas3c/ee9e953f010be24b7247c6b5c3a8beb2 to your computer and use it in GitHub Desktop.
How to add Bootstrap in Ruby on Rails App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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