Module: RailsMenu::ViewHelper

Defined in:
lib/rails_menu/view_helper.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
11
# File 'lib/rails_menu/view_helper.rb', line 4

def menu(set_name = 'default')
  set = RailsMenu::Set[set_name]
  elements = set.nil? ? [] : set.elements
  elements.each do |elem|
    elem.active = (@rails_menu_active.to_s == elem.id ? true : false)
  end
  elements
end