lib/ccs/components/govuk/field/inputs/item/checkbox.rb in ccs-frontend_helpers-0.1.2 vs lib/ccs/components/govuk/field/inputs/item/checkbox.rb in ccs-frontend_helpers-0.2.0
- old
+ new
@@ -15,24 +15,12 @@
# label [Hash] attributes for the checkbox label, see {CCS::Components::GovUK::Label#initialize Label#initialize} for more details.
#
# @option (see CCS::Components::GovUK::Field::Items::Item#initialize))
def initialize(attribute:, label:, **options)
- super(attribute: attribute, **options)
+ super(attribute: attribute, item_class: 'govuk-checkboxes__item', **options)
label[:classes] = "govuk-checkboxes__label #{label[:classes]}".rstrip
- end
-
- # Generates the HTML to wrap arround a checkbox input
- #
- # @yield the checkbox item input HTML
- #
- # @return [ActiveSupport::SafeBuffer]
-
- def render(&block)
- tag.div(class: 'govuk-checkboxes__item') do
- super(&block)
- end
end
# The default attributes for the checkbox
DEFAULT_ATTRIBUTES = { class: 'govuk-checkboxes__input' }.freeze