Module: SimpleMenu::MenuHelper
- Defined in:
- lib/simple_menu.rb
Defined Under Namespace
Classes: MenuBuilder
Instance Method Summary (collapse)
Instance Method Details
- (Object) menu_tag(name, options = {}, &block)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_menu.rb', line 9 def (name, = {}, &block) [:id] = name.to_s unless [:id] seperator = .delete(:seperator) || "" = MenuBuilder.new(@current_tab) = capture { block.call() } || "" .items.map do |item| link = link_to(item.delete(:link_text), item.delete(:link_url), item.delete(:link_options)) link = "#{link} #{seperator}" unless .items.last?(item) << content_tag(:li, link, item) end concat content_tag(:ul, , ) end |