Class: Pajamas::RadioTagComponent
- Defined in:
- app/components/pajamas/radio_tag_component.rb
Instance Method Summary collapse
-
#initialize(name:, value:, checked: false, label: nil, help_text: nil, label_options: {}, radio_options: {}) ⇒ RadioTagComponent
constructor
A new instance of RadioTagComponent.
Methods included from Concerns::CheckboxRadioOptions
Methods included from Concerns::CheckboxRadioLabelWithHelpText
#render_label_tag_with_help_text, #render_label_with_help_text
Constructor Details
#initialize(name:, value:, checked: false, label: nil, help_text: nil, label_options: {}, radio_options: {}) ⇒ RadioTagComponent
Returns a new instance of RadioTagComponent.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/components/pajamas/radio_tag_component.rb', line 12 def initialize( name:, value:, checked: false, label: nil, help_text: nil, label_options: {}, radio_options: {} ) @name = name @value = value @checked = checked @label_argument = label @help_text_argument = help_text @label_options = @label_options[:for] ||= label_for(name, value) @input_options = end |