Class: Nav::TabPanelsComponent
- Inherits:
-
TabsComponent
- Object
- TabsComponent
- Nav::TabPanelsComponent
- Defined in:
- app/components/spark/nav/tab_panels_component.rb
Instance Method Summary collapse
Instance Method Details
#active_item_text ⇒ Object
18 19 20 |
# File 'app/components/spark/nav/tab_panels_component.rb', line 18 def active_item_text panels.first.text end |
#render ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/spark/nav/tab_panels_component.rb', line 4 def render panels.each_with_index { |panel, index| items << panel.new_tab(active: index == 0) } content_tag(:div, class: "nav-tab-panels") do concat super panels.each_with_index { |panel, index| panel.active = index == 0 concat content_tag(:div, panel.yield, panel.tag_attrs) } end end |