Class: Nav::PillsComponent
- Inherits:
-
SparkComponents::Component
- Object
- SparkComponents::Component
- Nav::PillsComponent
- Defined in:
- app/components/spark/nav/pills_component.rb
Instance Method Summary collapse
Instance Method Details
#before_render ⇒ Object
12 13 14 |
# File 'app/components/spark/nav/pills_component.rb', line 12 def before_render add_class %(layout-#{layout}) end |
#render ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/components/spark/nav/pills_component.rb', line 16 def render return if items.empty? content_tag(:nav, tag_attrs) do content_tag(:div, class: "nav-pills-wrapper") { concat content_tag(:ul, class: "spark-nav-group") { items.each { |item| concat content_tag(:li, item, class: "nav-pill-wrapper #{item.active? ? "active" : nil}") } } } end end |