Class: CCS::Components::GovUK::Fieldset
- Defined in:
- lib/ccs/components/govuk/fieldset.rb,
lib/ccs/components/govuk/fieldset/legend.rb
Overview
GOV.UK Fieldset
This is used to generate the fieldset component from the GDS - Components - Fieldset
Defined Under Namespace
Classes: Legend
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the fieldset
{ class: 'govuk-fieldset' }.freeze
Instance Method Summary collapse
-
#initialize(legend: nil, **options) ⇒ Fieldset
constructor
A new instance of Fieldset.
-
#render { ... } ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Fieldset component.
Constructor Details
Instance Method Details
#render { ... } ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Fieldset component
41 42 43 44 45 46 |
# File 'lib/ccs/components/govuk/fieldset.rb', line 41 def render tag.fieldset(**[:attributes]) do concat(legend.render) if legend yield if block_given? end end |