Skip to content

Instantly share code, notes, and snippets.

@cadyherron
Last active February 29, 2016 23:51
Show Gist options
  • Save cadyherron/17d68369ace6f77b91e2 to your computer and use it in GitHub Desktop.
Save cadyherron/17d68369ace6f77b91e2 to your computer and use it in GitHub Desktop.
Steps to create a basic Rails app with Bootstrap
  1. create rails app with rails new yourapp --database=postgresql -T

  2. create Github repo, cd into your app, git init, git remote add origin [email protected]:username/yourapp.git, git commit -am, git push -u origin master

  3. add to Gemfile:

      gem 'jazz_hands', github: 'nixme/jazz_hands', branch: 'bring-your-own-debugger'
      gem 'pry-byebug'
      gem 'better_errors'
    end```
    
    `gem 'bootstrap-sass', '~> 3.3.6'`
    
    
  4. set up bootstrap:

    $ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss

    add the following to app/assets/stylesheets/application.scss:

    @import "bootstrap";```
    
    add the following to `app/assets/javascripts/application.js`:
    ```//= require jquery
    //= require bootstrap-sprockets```
    (remove `*= require_self`)
    
    
  5. wipe out turbolinks:

    remove 'turbolinks' from your Gemfile

    remove the //= require turbolinks line from your app/assets/javascripts/application.js file

    remove the two "data-turbolinks-track" => true hash key/value pairs from your app/views/layouts/application.html.erb

  6. bundle install

  7. Start building!

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