Class: Bootstrap::ViewHelpers::Components::Accordion

Inherits:
Bootstrap::ViewHelpers::Component show all
Defined in:
lib/bootstrap/view_helpers/components/accordion.rb,
lib/bootstrap/view_helpers/components/accordion/card.rb,
lib/bootstrap/view_helpers/components/accordion/button.rb

Defined Under Namespace

Classes: Button, Card

Instance Attribute Summary

Attributes inherited from Bootstrap::ViewHelpers::Component

#block, #options, #style, #view

Instance Method Summary collapse

Methods inherited from Bootstrap::ViewHelpers::Component

#initialize

Constructor Details

This class inherits a constructor from Bootstrap::ViewHelpers::Component

Instance Method Details

#group(title, options = {}, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/bootstrap/view_helpers/components/accordion.rb', line 16

def group(title, options = {}, &block)
  options[:title] = title
  options[:body] = true
  options[:parent] = accordion_id
  Card.new(view, options, &block).to_html
end

#to_htmlObject



10
11
12
13
14
# File 'lib/bootstrap/view_helpers/components/accordion.rb', line 10

def to_html
  (:div, options.merge({ id: accordion_id })) do
    block.call(self)
  end
end