Class: GOVUKDesignSystemFormBuilder::Elements::Radios::Collection
- Includes:
- Traits::Error, Traits::Hint, Traits::Supplemental
- Defined in:
- lib/govuk_design_system_formbuilder/elements/radios/collection.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name, attribute_name, collection, value_method:, text_method:, hint_method:, hint:, legend:, caption:, inline:, small:, bold_labels:, form_group:, include_hidden:, **kwargs, &block) ⇒ Collection
constructor
A new instance of Collection.
Methods included from Traits::Supplemental
Methods included from Traits::Hint
Methods included from Traits::Error
Methods inherited from Base
Constructor Details
#initialize(builder, object_name, attribute_name, collection, value_method:, text_method:, hint_method:, hint:, legend:, caption:, inline:, small:, bold_labels:, form_group:, include_hidden:, **kwargs, &block) ⇒ Collection
Returns a new instance of Collection.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/govuk_design_system_formbuilder/elements/radios/collection.rb', line 9 def initialize(builder, object_name, attribute_name, collection, value_method:, text_method:, hint_method:, hint:, legend:, caption:, inline:, small:, bold_labels:, form_group:, include_hidden:, **kwargs, &block) super(builder, object_name, attribute_name, &block) @collection = collection @value_method = value_method @text_method = text_method @hint_method = hint_method @inline = inline @small = small @legend = legend @caption = @hint = hint @form_group = form_group @include_hidden = include_hidden @bold_labels = (bold_labels.nil? && auto_bold_labels?) || bold_labels @html_attributes = kwargs end |
Instance Method Details
#html ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/govuk_design_system_formbuilder/elements/radios/collection.rb', line 27 def html Containers::FormGroup.new(*bound, **@form_group).html do Containers::Fieldset.new(*bound, **).html do safe_join([hidden_field, supplemental_content, hint_element, error_element, radios]) end end end |