Module: BootstrapComponentsHelpers::TabsHelper
- Defined in:
- lib/bootstrap-components-helpers/tabs_helper.rb
Defined Under Namespace
Classes: TabsBuilder
Instance Method Summary collapse
Instance Method Details
#tabs(opts = {}) {|builder| ... } ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/bootstrap-components-helpers/tabs_helper.rb', line 3 def tabs opts = {} opts[:style] ||= 'tabs' builder = TabsBuilder.new self yield builder pane_handles_html = builder.pane_handles_html return unless pane_handles_html tabs = content_tag(:ul, builder.pane_handles_html, class: "nav nav-#{opts[:style]}") contents = content_tag(:div, builder.pane_contents_html, class: 'tab-content') content_tag :div do tabs + contents end end |