Sha256: 040b4ef0756be3f6ec8f6fef47ae26f9b07e035df40ce83535523d0095873904
Contents?: true
Size: 761 Bytes
Versions: 2
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true module Yattho module Forms # :nodoc: class RadioButton < BaseComponent delegate :builder, :form, to: :@input def initialize(input:) @input = input @input.add_label_classes("FormControl-label") @input.add_input_classes("FormControl-radio") end def nested_form_arguments return @nested_form_arguments if defined?(@nested_form_arguments) @nested_form_arguments = { hidden: @input.hidden?, **@input.nested_form_arguments } @nested_form_arguments[:class] = class_names( @nested_form_arguments[:class], @nested_form_arguments.delete(:classes), "ml-4" ) @nested_form_arguments end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yattho_view_components-0.1.1 | lib/yattho/forms/radio_button.rb |
yattho_view_components-0.0.1 | lib/yattho/forms/radio_button.rb |