Created
March 25, 2015 05:05
-
-
Save prank7/a593823722e3f5eb0418 to your computer and use it in GitHub Desktop.
Integrating Bootstrap into Ruby On Rails
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
// application.js. Make sure jquery is before bootstrap-sprockets and tree is at last, like it is here. | |
//= require jquery | |
//= require jquery_ujs | |
//= require turbolinks | |
//= require bootstrap-sprockets | |
//= require_tree . | |
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
#In newly created custom.css.scss, add these lines to import bootstrap files. | |
@import 'bootstrap-sprockets'; | |
@import 'bootstrap'; | |
# This will pull in all css of bootstrap into our assets pipeline. How about bootstrap javascript files? | |
# Rails 4 and bootstrap-sass 3.2.0.0, automatically add this to our app/assets/javascripts/application.js file. | |
# but just to make sure everything works fine. Check your app/assets/javascripts/application.js file. It should be like | |
# the file in gist named "application.js". |
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
# In Gemfile, add the following line to specify 'bootstrap-sass' gem. I am using version 3.2.0.0. | |
gem 'bootstrap-sass', '3.2.0.0' | |
# After adding this line, install this gem by runing this command in your terminal- "bundle install" | |
# Now we have the gem installed. We need to add this to our asset pipeline in order to use bootstrap. To do so, create a new file in | |
# app/assets/stylesheets/ folder named "custom.css.scss", Or you can also rename "application.css" to "application.css.scss". | |
# see the next file in gist named "custom.css.scss" to see what goes there. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment