Skip to content

Instantly share code, notes, and snippets.

@chand
Last active August 26, 2017 15:38
Show Gist options
  • Save chand/1a780509adca3193c5b51f9b8e2eaa01 to your computer and use it in GitHub Desktop.
Save chand/1a780509adca3193c5b51f9b8e2eaa01 to your computer and use it in GitHub Desktop.
Boostrap Setup for Ruby on Rails

Bootstrap Setup for Ruby on Rails

  1. Set up new rails project if not done so yet

  2. In the gemfile:

gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'
  1. In the command line:
bundle install
  1. In app > assets > stylesheets > application.css: rename to application.scss OR application.sass (if you want to use sass) add below comments section (after */):
@import "bootstrap-sprockets";
@import "bootstrap";

(if you are using application.sass, get rid of the ';' after each line and MAKE SURE there is no indentation)

  1. In app > assets > javascripts > appplication.js:
//= require jquery
//= require bootstrap-sprockets
  1. In app > views > layouts > application.html.erb, in the tag:
<meta name="viewport" content="width=device-width, initial-scale=1">

Source 1 | Source 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment