Sha256: 9665b58fa8510b8a9e563765ad55e913f45622cdd505f2d9006dbdefab505270
Contents?: true
Size: 575 Bytes
Versions: 6
Compression:
Stored size: 575 Bytes
Contents
# frozen_string_literal: true module Primer module Forms # :nodoc: class CheckBox < BaseComponent delegate :builder, :form, to: :@input def initialize(input:) @input = input @input.add_label_classes("FormControl-label") @input.add_input_classes("FormControl-checkbox") return unless @input.scheme == :array @input.input_arguments[:multiple] = true @input.label_arguments[:value] = checked_value end private def checked_value @input.value || "1" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems