Module: LogicalTabs::Helper

Defined in:
lib/logical_tabs/helper.rb

Instance Method Summary collapse

Instance Method Details

#tabbed_panel(options = {}, &block) ⇒ Object Also known as: create_tabbed_panel



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/logical_tabs/helper.rb', line 5

def tabbed_panel( options = {}, &block)
  @panel_count = defined?(@panel_count) ? @panel_count + 1 : 0
  options.merge!({:seq => @panel_count}) unless options[:base_id]
  tabbed_panel = TabbedPanel.new(self, options)

  if block_given?
    yield(tabbed_panel)
    output = tabbed_panel.render
    output
  end
  return output
end

#wrap_in_div(id, &block) ⇒ Object



20
21
22
# File 'lib/logical_tabs/helper.rb', line 20

def wrap_in_div(id, &block)
  (:div, capture(&block), :class => 'wrapper', :id => id)
end