Rails Menu Manager
Simple menu manager for Rails. Besides a flat menu structure it supports multiple navigation menus and nested menus as well.
Installation
Add this line to your application's Gemfile:
gem 'rails-menu-manager'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails-menu-manager
Usage
Set menu path in controller:
class FooController < ApplicationController
:main, :users, except: [:index]
def index
:sidebar, :users
end
end
Highlight current navigation link(s):
content_tag :li, 'Menu', class: (:main) ? 'active' : nil
link_to 'users', users_path, class: (:main, :users) ? 'active' : nil
link_to 'users', users_path, class: (:sidebar, :users) ? 'active' : nil