Class: Matestack::Ui::Bootstrap::Components::Accordion

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/accordion.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject



12
13
14
# File 'lib/matestack/ui/bootstrap/components/accordion.rb', line 12

def prepare
  @accordion_id = (context.id.present? ? context.id : "matestack-accordion-#{SecureRandom.hex(3)}")
end

#responseObject



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

def response
  div accordion_attributes do
    accordion_content_partial if context.items.present?
    yield if block_given?
  end
end