Class: CCS::Components::GovUK::Field::Inputs::Item::Checkbox
- Inherits:
-
CCS::Components::GovUK::Field::Inputs::Item
- Object
- Base
- CCS::Components::GovUK::Field::Inputs::Item
- CCS::Components::GovUK::Field::Inputs::Item::Checkbox
- Defined in:
- lib/ccs/components/govuk/field/inputs/item/checkbox.rb,
lib/ccs/components/govuk/field/inputs/item/checkbox/tag.rb,
lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb
Overview
GOV.UK Field Inputs Checkbox
This is used to generate an individual checkbox item
Defined Under Namespace
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the checkbox
{ class: 'govuk-checkboxes__input' }.freeze
- ITEM_TYPE =
The type of the input item
'checkboxes'.freeze
Instance Method Summary collapse
-
#initialize(attribute:, label:, **options) ⇒ Checkbox
constructor
label [Hash] attributes for the checkbox label, see Label#initialize for more details.
Methods inherited from CCS::Components::GovUK::Field::Inputs::Item
Constructor Details
#initialize(attribute:, label:, **options) ⇒ Checkbox
label [Hash] attributes for the checkbox label, see Label#initialize for more details.
19 20 21 22 23 |
# File 'lib/ccs/components/govuk/field/inputs/item/checkbox.rb', line 19 def initialize(attribute:, label:, **) super(attribute: attribute, item_class: 'govuk-checkboxes__item', **) label[:classes] = "govuk-checkboxes__label #{label[:classes]}".rstrip end |