Sha256: 4e4516bdaed31f88d76ab350500149be5bcfc20dd702400a0f8aeba55fb710d5
Contents?: true
Size: 966 Bytes
Versions: 1
Compression:
Stored size: 966 Bytes
Contents
=Dynamic Menu ==Introduction Dynamic Menu is a gem to make it easy to add a custom menu to your application via a controller. == Install You need to add: gem "dynamic_menu",:git=>"git://github.com/plowdawg/dynamic_menu.git" to your gemfile == How to use You can create an array in a controller like so: @actionMenuItem = Array.new option1 = DynamicMenu::ActionMenuItem.new("Name",link_to_path) @actionMenuItem[0] = option1 then you can refrence it by using a loop such as @actionMenuItem.each do |menu| menu.link_tag #this generates the entire link end if you need a delete and confirmation method then you can declare it like so: option1 = DynamicMenu::ActionMenuItem.new("Link Name", link_to_path, :delete, "Are you sure?") the first is what the link will look like on the view, second is the view, third is the method (only works for delete) and the fourth is the confirmation method (which also only works on delete)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dynamic_menu-0.1.0 | README.rdoc |