Provides a Library to allow you to create a dynamic menu
Ruby JavaScript CSS
Latest commit 500abf7 Aug 15, 2013 @travispessetto Bump patch version
Failed to load latest commit information.
lib Bump patch version Aug 14, 2013
test RC2 Jul 12, 2013
.gitignore
.project New Version Jul 1, 2013
Gemfile New Version Jul 1, 2013
Gemfile.lock Latest changes Jul 1, 2013
MIT-LICENSE
README.md
Rakefile New Version Jul 1, 2013
dynamic_menu-3.0.0.gem
dynamic_menu-3.0.1.gem
dynamic_menu.gemspec Fix lic Aug 6, 2013

README.md

Dynamic_Menu

As of versions >= 3.0.0 dynamic_menu has drastically changed. Menus are now in their own folder and can inherit routes from each other.

Installing

Gemfile:

gem "dynamic_menu","~>3.0.0"

Console:

rails g dynamic_menu:install

Now your application's structure should be setup to allow the use of dynamic_menu.

Generating a menu

To generate the base class for your menu you can go to the console and type:

rails g dynamic_menu::menu controller:action

for example:

rails g dynamic_menu users::new

You will find your menus in app/menus. There you can add or change what you need. Use add to add a new link.

add link_to "Google","http://google.com"

If you want to inherit from another menu within the same folder (same controller) use:

inherit_from "name-of-other-menu"  #put in the build_menu command.

Your view:

#Consider putting this in your layout to make it easier!
<ul>
<% get_current_menu.get_menu_links.each do |link| %>
    <li><%= link %></li>
</ul>