. . .

Using Twitter Bootstrap with Ruby on Rails

Published: February 13, 2015

On This Page

    Step by step guide to integrate Twitter Bootstrap with Ruby on Rails application. Please note that after these steps, your application layout file will be replaced with default one.

    Step1: Add gem to your Gemfile

    gem 'twitter-bootstrap-rails'

    Step 2: Install required gem. To do that, on terminal, run
    bundle install

    Step 3: Run bootstrap install scripts using following command

    rails g bootstrap:install static

    Step 4: Update application layouts

    rails g bootstrap:layout [LAYOUT_NAME]
    e.g
    rails g bootstrap:layout application fixed
    rails g bootstrap:layout application fluid

    Step 5: To generate Bootstrap compatible scaffold views, use
    rails g bootstrap:themed [RESOURCE_NAME]
    e.g
    rails g bootstrap:themed Restaurants

    Be very careful that these generators will overwrite existing files thus removing previous content.

    Step 6: Asset precompilation using
    rake assets:precompile

    Step 7: Don't forget to restart your application using
    touch tmp/restart.txt

    Don't forget to share this post

      Let's Build Digital Excellence Together


      • Cost Efficient Solutions.
      • Minimal Timelines.
      • Effective Communication.
      • High Quality Standards.
      • Lifetime Support.
      • Transparent Execution.
      • 24/7 Availability.
      • Scalable Teams.

      Join Our 200+ Happy Clients Across Globe


      Free Consultation.

        Do you need tech help of your startup/business? Experts from our team will get in touch with you.

        Please do not post jobs/internships inquiries here.