Module: MenuHelper

Defined in:
app/helpers/menu_helper.rb

Instance Method Summary collapse

Instance Method Details

#p_menu(id, options = {}, &block) ⇒ Object



3
4
5
6
# File 'app/helpers/menu_helper.rb', line 3

def p_menu(id,options={},&block)    
   output = menu_encode_markup(id,options,&block)  
   output += menu_encode_script(id,options)              		                        
end

#p_menu_item(path, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'app/helpers/menu_helper.rb', line 15

def p_menu_item(path,options={})   
  options = options.stringify_keys
  value = options.delete('value')
  options["data-icon"] = options['icon']    
  output = ('li') do      
    link_to(value,path,options)
  end 
end

#p_submenu(label, &block) ⇒ Object



8
9
10
11
12
13
# File 'app/helpers/menu_helper.rb', line 8

def p_submenu(label,&block)               
  output = ('li') do
    ('h3', label);
  end
  output += capture(&block)
end