Module: MenubarHelper

Defined in:
app/helpers/menubar_helper.rb

Instance Method Summary collapse

Instance Method Details

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



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

def p_menubar(id,options={},&block)    
   output = menubar_encode_markup(id,options,&block)  
   output += menubar_encode_script(id,options)              		                        
end

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



23
24
25
26
27
28
29
30
# File 'app/helpers/menubar_helper.rb', line 23

def p_menubar_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_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 p_submenubar(options = {},&block)               
  options = options.stringify_keys
  output = ('li') do
    data_icon = {}
    data_icon["data-icon"] = options.delete('icon')
    content = ('a', options['label'],data_icon);
    
    if block_given?
      content += ('ul') do
        capture(&block)
      end      
    end 
  end   
end