Sha256: 1c76f099181d1a6345fe8aabf8768c3c4390d8da532865e69afbd21ea42b327d

Contents?: true

Size: 528 Bytes

Versions: 9

Compression:

Stored size: 528 Bytes

Contents

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

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

  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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.14 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.13 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.12 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.10 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.8 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.5 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.4 app/helpers/components/accordion_helper.rb
shadcn-ui-0.0.3 app/helpers/components/accordion_helper.rb