class Interview::Tabs
Attributes
active[RW]
Public Instance Methods
build(b) { || ... }
click to toggle source
# File lib/interview/controls/tabs.rb, line 6 def build(b) b.section style: 'ul', html_class: 'nav nav-tabs' do b.meta_control pointer: self do @index = 0 yield if block_given? end end end
build_child(b, control, &block)
click to toggle source
Calls superclass method
Interview::Control#build_child
# File lib/interview/controls/tabs.rb, line 15 def build_child(b, control, &block) html_class = 'active' if @index == @active @index += 1 b.section style: 'li', html_class: html_class, html_options: { role: 'presentation' } do super end end