Class: Interview::Tab
- Includes:
- HasHtmlOptions
- Defined in:
- lib/interview/controls/tab.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#caption ⇒ Object
Returns the value of attribute caption.
Attributes included from HasHtmlOptions
Attributes inherited from Control
Instance Method Summary collapse
Methods included from HasHtmlOptions
Methods inherited from Control
#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
6 7 8 |
# File 'lib/interview/controls/tab.rb', line 6 def active @active end |
#caption ⇒ Object
Returns the value of attribute caption.
6 7 8 |
# File 'lib/interview/controls/tab.rb', line 6 def @caption end |
Instance Method Details
#build(b) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/interview/controls/tab.rb', line 8 def build(b) html_class = @html_class.dup = @html_options.dup html_class << 'tab-pane' html_class << 'active' if @active [:id] = @caption if @caption b.section html_class: html_class, html_options: do yield if block_given? end end |
#build_caption(b) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/interview/controls/tab.rb', line 19 def (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 |