Rails Bootstrap Navbar
Easily generate a Bootstrap navbar in your Rails app
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install rails_bootstrap_navbar
The necessary files from Bootstrap >= 2.0 have to be included separately, they are not part of this gem.
At least the CSS files for the navbar are required, and the JS files for dropdowns and responsive features, if you want to use those in the navbar.
Set Bootstrap version
This gem needs to know which Bootstrap version you are using, because the navbar HTML looks different in different Bootstrap versions.
If you're using either the
bootstrap gem, you're all set because the Boostrap version will be sniffed automatically from those gems' versions. Make sure to include the
bootstrap gem before
rails_bootstrap_navbar in your Gemfile though.
If you include the Bootstrap CSS and JS some other way, you need to set the Bootstrap version explicitly in an initializer:
# config/initializers/rails-bootstrap-navbar.rb BootstrapNavbar.configure do |config| config.bootstrap_version = '4.0.0' end
Thanks to Jules Copeland for the initial version of this gem!
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request