class Interview::Tab

Attributes

active[RW]
caption[RW]

Public Instance Methods

build(b) { || ... } click to toggle source
# File lib/interview/controls/tab.rb, line 8
def build(b)
  html_class = @html_class.dup
  html_options = @html_options.dup
  html_class << 'tab-pane'
  html_class << 'active' if @active
  html_options[:id] = @caption if @caption
  b.section html_class: html_class, html_options: html_options do
    yield if block_given?
  end
end
build_caption(b) click to toggle source
# File lib/interview/controls/tab.rb, line 19
def build_caption(b)
  html_class = control.active ? 'active' : ''
  b.section style: 'li', html_class: html_class do
    b.link caption: @caption, url: "##{@caption}", html_options: { data: { toogle: 'tab' } }
  end
end