lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb in ccs-frontend_helpers-0.3.0 vs lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb in ccs-frontend_helpers-0.5.0.beta0

- old
+ new

@@ -15,11 +15,11 @@ # @param (see CCS::Components::GovUK::Field::Items::Item::Checkbox#initialize) # # @option (see CCS::Components::GovUK::Field::Items::Item::Checkbox#initialize) def initialize(attribute:, label:, **options) - super(attribute: attribute, label: label, **options) + super (label[:attributes] ||= {})[:value] = @value label[:attributes][:for] = @options[:attributes][:id] if @options[:attributes][:id] @options[:attributes][:multiple] = true @@ -31,10 +31,10 @@ # Generates the HTML for the checkbox input # # @return [ActiveSupport::SafeBuffer] def render - super() do + super do @options[:form].check_box(@attribute, @options[:attributes], @value) end end end end