- Published on
Bootstrap SB Admin Base V2 for Rails
- Authors
- Name
- Iván González
- @dreamingechoes
bootstrap_sb_admin_base_v2
is a Rails gem that integrates the Bootstrap-based admin theme SB Admin 2. Originally created by Start Bootstrap, this gem adapts the theme for easy integration into Rails applications by managing fonts, images, CSS, and JavaScript assets.
Check out the original Bootstrap admin theme repository here.
Installation
Add this line to your Gemfile
:
gem 'bootstrap_sb_admin_base_v2'
Then run:
bundle install
Or install it manually:
gem install bootstrap_sb_admin_base_v2
Usage
Version 0.2.x and Below
After installing the gem, add these lines to your manifest files:
In application.js
:
//= require bootstrap_sb_admin_base_v2
In application.css
:
*= require bootstrap_sb_admin_base_v2
Version 0.3.x and Above
From version 0.3.x, two dependencies were added: jquery-rails
and font-awesome-rails
to keep jQuery and Font Awesome updated.
Ensure jquery-rails
is required before bootstrap_sb_admin_base_v2
in application.js
:
//= require jquery
//= require jquery_ujs
//= require bootstrap_sb_admin_base_v2
And in application.css
, require font-awesome-rails
:
*= require font-awesome
*= require bootstrap_sb_admin_base_v2
RTL Version
For the RTL version of the template, use this in application.css
instead:
*= require bootstrap_sb_admin_base_v2_rtl
Check out the RTL adaptation here.
With this setup, you can use the SB Admin 2 Bootstrap template in your Rails application. For full documentation, visit SB Admin 2.
Where Can I Find the Code?
The gem’s source code is available on GitHub. Feel free to clone, modify, and experiment with it! 😃
Example Usage in a Rails Application
To make testing easier, I created a simple Rails template application as a starting point for new projects. Check out rails-blank-template-app.