Skip to content

Instantly share code, notes, and snippets.

@prank7
Created March 25, 2015 05:05
Show Gist options
  • Save prank7/a593823722e3f5eb0418 to your computer and use it in GitHub Desktop.
Save prank7/a593823722e3f5eb0418 to your computer and use it in GitHub Desktop.
Integrating Bootstrap into Ruby On Rails
// 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 .
#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".
# 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