Rajeev Kannav Sharma

Posts About

using twitter-bootstrap via rails engine.

05 Mar 2016

We’re developing a Rails engine Message Broker which will do some awesome things. As User Interface proposed by me is rejected from the scratch (May be you know the person) hence we opted Twitter-Bootstrap for Engine User Interface for simplicity. following are the steps which need to be done to use Twitter-Bootstrap.

  • add following to your engine_name.gemspec
   
     s.add_dependency 'bootstrap-sass', '~> 3.2.0'        
     s.add_dependency 'sass-rails'
   
   
  • require bootstrap to lib/engine_name.rb require 'bootstrap'

  • Rename application.css to application.css.sass and add following code

        @import 'bootstrap-sprockets'        
        @import 'bootstrap'
   
  • add //= require bootstrap-sprockets to your application.js after
        //= require jquery        
        //= require jquery_ujs
   
  • apply changes to your application layout and views

  • Restart Rails Server

And if you get stuck… Ask Here

email me rajeevsharma86@gmail.com

Tweet to me at @rajeevkannav.