Module: MenuHelper
- Defined in:
- app/helpers/menu_helper.rb
Instance Method Summary collapse
- #p_menu(id, options = {}, &block) ⇒ Object
- #p_menu_item(path, options = {}) ⇒ Object
- #p_submenu(label, &block) ⇒ Object
Instance Method Details
#p_menu(id, options = {}, &block) ⇒ Object
3 4 5 6 |
# File 'app/helpers/menu_helper.rb', line 3 def (id,={},&block) output = (id,,&block) output += (id,) end |
#p_menu_item(path, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/helpers/menu_helper.rb', line 15 def (path,={}) = .stringify_keys value = .delete('value') ["data-icon"] = ['icon'] output = content_tag('li') do link_to(value,path,) end end |
#p_submenu(label, &block) ⇒ Object
8 9 10 11 12 13 |
# File 'app/helpers/menu_helper.rb', line 8 def (label,&block) output = content_tag('li') do content_tag('h3', label); end output += capture(&block) end |