Module: TabviewHelper

Defined in:
app/helpers/tabview_helper.rb

Instance Method Summary collapse

Instance Method Details

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



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/tabview_helper.rb', line 8

def p_tab(id,options={},&block)
  options = options.stringify_keys
  forid = sanitize_to_id(options["for"])
       clientid = forid+":"+sanitize_to_id(id)    
  content_for(("tab_header_" + forid)) do
    (:li, nil) do
      title = options["title"]
      output = (:a, title, href: clientid)
      output += (:span, nil, class: "ui-icon ui-icon-close") if options["closable"]            
      output
    end 
  end    
  
  content_for(("tab_content_" + forid)) do
    (:div, nil, id: clientid) do
      capture(&block)       
    end 
  end              
end

#p_tabview(id, options = {}) ⇒ Object



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

def p_tabview(id,options={})    
       output = tabview_encode_markup(id,options)  
       output += tabview_encode_script(id,options)                                          
end