Closed jroof88 closed 8 years ago
Do you have two navbar gems loading? What's in your Gemfile.lock?
Hey @jroof88,
Thanks for mentioning this! It wasn't explained properly in the readme. You have two options:
bootstrap-sass
gem, simply include it in your Gemfile before rails_bootstrap_navbar
, then the Bootstrap version will be set automatically.bootstrap-sass
, add an initializer and set the Bootstrap version there:# config/initializers/rails-bootstrap-navbar.rb
BootstrapNavbar.configure do |config|
config.bootstrap_version = '4.0.0'
end
Thanks @manuelmeurer! Works great now!
@manuelmeurer If I am using bootstrap 4.0.0 and following the wiki for Boostrap 3.x should it work the same?
No, not really. The navbar was simplified a lot in Bootstrap 4.
This should work:
= navbar container: true do
= navbar_group do
= navbar_item 'Item 1', '/item-1'
= navbar_item 'Item 2', '/item-2'
= navbar_collapse toggleable: true do
= navbar_group do
= navbar_item 'Item 3', '/item-3'
= navbar_item 'Item 4', '/item-4'
Check the source for all available options to the methods. I'll add full examples to the wiki page soon... 😄
Thanks got it all figured. Great gem!
Hello,
I am new to Rails and Gems so this may have an easy answer but when I follow the instructions to use this gem. I have this in my gemfile:
gem 'rails_bootstrap_navbar'
And then when try to run the server I get the error:
/usr/local/lib/ruby/gems/2.3.0/gems/bootstrap-navbar-2.3.0/lib/bootstrap-navbar/helpers.rb:9:in included: Bootstrap version is not configured. (RuntimeError)
I tried configuring the Bootstrap version using the instructions from bootstrap-navbar but still no luck. Any help would be greatly appreciated!
Thanks!