Sha256: fb725903f467263d20793d0cb2d5ffbd332a97644c32339b91d6aaafb280fa84
Contents?: true
Size: 783 Bytes
Versions: 25
Compression:
Stored size: 783 Bytes
Contents
module GOVUKDesignSystemFormBuilder module Elements module CheckBoxes class Label < Base using PrefixableArray include Traits::Localisation def initialize(builder, object_name, attribute_name, checkbox, value:, link_errors: true) super(builder, object_name, attribute_name) @checkbox = checkbox @value = value @link_errors = link_errors end def html @checkbox.label(for: field_id(link_errors: @link_errors), class: label_classes) do [localised_text(:label), @checkbox.text, @value].compact.first end end private def label_classes %w(label checkboxes__label).prefix(brand) end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems