Module: MenubarHelper
- Defined in:
- app/helpers/menubar_helper.rb
Instance Method Summary collapse
- #p_menubar(id, options = {}, &block) ⇒ Object
- #p_menubar_item(path, options = {}) ⇒ Object
- #p_submenubar(options = {}, &block) ⇒ Object
Instance Method Details
#p_menubar(id, options = {}, &block) ⇒ Object
3 4 5 6 |
# File 'app/helpers/menubar_helper.rb', line 3 def (id,={},&block) output = (id,,&block) output += (id,) end |
#p_menubar_item(path, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/helpers/menubar_helper.rb', line 23 def (path,={}) = .stringify_keys value = .delete('value') ["data-icon"] = ['icon'] output = content_tag('li') do link_to(value,path,) end end |
#p_submenubar(options = {}, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/menubar_helper.rb', line 8 def ( = {},&block) = .stringify_keys output = content_tag('li') do data_icon = {} data_icon["data-icon"] = .delete('icon') content = content_tag('a', ['label'],data_icon); if block_given? content += content_tag('ul') do capture(&block) end end end end |