How to install the bootstrap-sass gem - Women Who Code.
post-template-default,single,single-post,postid-52100,single-format-standard,qode-core-1.0.1,ajax_fade,page_not_loaded,,capri child-child-ver-1.0.0,capri-ver-1.6, vertical_menu_with_scroll,smooth_scroll,grid_1200,blog_installed,wpb-js-composer js-comp-ver-4.12.1,vc_responsive

How to install the bootstrap-sass gem

How to install the bootstrap-sass gem

  • Add bootstrap-sass gem to the Gemfile:
    gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
    or install it from your terminal: gem install bootstrap-sass -v 3.3.6
  • Restart the server (ctrl+c, rails s) to make the files available through the pipeline
  • Rename file extension app/assets/stylesheets/application.css to .scss
  • In the bottom of this file (don’t touch anything else), add:
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
@import "bootstrap-sprockets";
@import "bootstrap";
  • In the file app/assets/javascripts/application.js add:
//= require jquery
//= require bootstrap-sprockets
  • Refresh your project page in the browser (localhost:3000) – it will look boostrap-styled after that
  • If you have the file app/assets/stylesheets/scaffolds.scss, you can delete everything inside it since it will be overridden by bootstrap anyway

Useful links:
bootstrap-sass on Rubygems
bootstrap-sass documentation
SO: difference between bootstrap-sass and twitter-bootstrap-rails gems

bootstrap-sass vs twitter-bootstrap-rails

twitter-bootstrap-rails this gem offers not only bootstrap itself, but also some handy helpers and a layout generator
bootstrap-sass – official bootstrap gem

No Comments

Post a Comment