seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.5k stars 998 forks source link

Navbar and namespaced routes #815

Closed alec-c4 closed 9 years ago

alec-c4 commented 9 years ago

There are issue with navbar in layouts under any namespace. For example my routes is:

  namespace :admin do
    get '/' => 'home#index'
    resources :workplaces
  end

and i have in my admin-layout following

    = nav_bar :static => :top, :brand => 'Test App', :brand_link =>  root_path do
      = menu_group do
        = menu_item 'Home', admin_path
        = menu_item 'Workspaces', admin_workplaces_path

and i see following in browser:

<ul class="nav navbar-nav ">
   <li class="active"><a href="/admin">Home</a></li> 
   <li class="active"><a href="/admin/workplaces">Workspaces</a></li>
</ul>

As you may see - both LI have active class. How to solve it?

toadkicker commented 9 years ago

See https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/navbar_helper.rb#L69