Class: GOVUKDesignSystemFormBuilder::Elements::CheckBoxes::Collection
- Includes:
- Traits::Error, Traits::Hint, Traits::Supplemental
- Defined in:
- lib/govuk_design_system_formbuilder/elements/check_boxes/collection.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(builder, object_name, attribute_name, collection, value_method:, text_method:, hint:, legend:, caption:, small:, form_group:, include_hidden:, hint_method: nil, **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:, legend:, caption:, small:, form_group:, include_hidden:, hint_method: nil, **kwargs, &block) ⇒ Collection
Returns a new instance of Collection.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/govuk_design_system_formbuilder/elements/check_boxes/collection.rb', line 9 def initialize(builder, object_name, attribute_name, collection, value_method:, text_method:, hint:, legend:, caption:, small:, form_group:, include_hidden:, hint_method: nil, **kwargs, &block) super(builder, object_name, attribute_name, &block) @collection = collection @value_method = value_method @text_method = text_method @hint_method = hint_method @small = small @legend = legend @caption = @hint = hint @form_group = form_group @include_hidden = include_hidden @html_attributes = kwargs end |
Instance Method Details
#html ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/govuk_design_system_formbuilder/elements/check_boxes/collection.rb', line 25 def html Containers::FormGroup.new(*bound, **@form_group).html do Containers::Fieldset.new(*bound, **).html do safe_join([supplemental_content, hint_element, error_element, check_boxes]) end end end |