Module: LesliView::Forms::Fieldset
- Included in:
- Builder
- Defined in:
- lib/lesli_view/forms/fieldset.rb
Instance Method Summary collapse
Instance Method Details
#fieldset(legend = "", options = {}, category: nil, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/lesli_view/forms/fieldset.rb', line 4 def fieldset(legend = "", = {}, category: nil, &block) [:class] = ["lesli-form-fieldset", "box", "pr-6", "is-#{category}"] [:class].push("pt-5") unless legend.present? @template.content_tag(:fieldset, ) do legend_html = legend.present? ? @template.content_tag(:h5, legend, class: ["is-size-5", "mb-5", "ml-2"]) : nil @template.safe_join([legend_html, @template.capture(&block)].compact) end end |