Class: GOVUKDesignSystemFormBuilder::Containers::Fieldset
- Includes:
- Traits::HTMLAttributes
- Defined in:
- lib/govuk_design_system_formbuilder/containers/fieldset.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name = nil, attribute_name = nil, legend: {}, caption: {}, described_by: nil, **kwargs, &block) ⇒ Fieldset
constructor
A new instance of Fieldset.
Methods included from Traits::HTMLAttributes
Methods inherited from Base
Constructor Details
#initialize(builder, object_name = nil, attribute_name = nil, legend: {}, caption: {}, described_by: nil, **kwargs, &block) ⇒ Fieldset
Returns a new instance of Fieldset.
6 7 8 9 10 11 12 13 14 |
# File 'lib/govuk_design_system_formbuilder/containers/fieldset.rb', line 6 def initialize(builder, object_name = nil, attribute_name = nil, legend: {}, caption: {}, described_by: nil, **kwargs, &block) super(builder, object_name, attribute_name, &block) @legend = legend @caption = @described_by = combine_references(described_by) @attribute_name = attribute_name @html_attributes = kwargs end |
Instance Method Details
#html ⇒ Object
16 17 18 19 20 |
# File 'lib/govuk_design_system_formbuilder/containers/fieldset.rb', line 16 def html tag.fieldset(**attributes(@html_attributes)) do safe_join([legend_element, (@block_content || yield)]) end end |