Module: Components::AccordionHelper

Defined in:
app/helpers/components/accordion_helper.rb

Instance Method Summary collapse

Instance Method Details

#accordion_description(&block) ⇒ Object



6
7
8
# File 'app/helpers/components/accordion_helper.rb', line 6

def accordion_description(&block)
  content_for :description, capture(&block), flush: true
end

#accordion_title(&block) ⇒ Object



2
3
4
# File 'app/helpers/components/accordion_helper.rb', line 2

def accordion_title(&block)
  content_for :title, capture(&block), flush: true
end

#render_accordion(title: nil, description: nil, &block) ⇒ Object



10
11
12
13
14
15
16
17
# File 'app/helpers/components/accordion_helper.rb', line 10

def render_accordion(title: nil, description: nil, &block)
  if title && !description
    content_for :description, capture(&block), flush: true
  elsif !title && !description
    capture(&block)
  end
  render "components/ui/accordion", title: title, description: description
end