Class: Pajamas::RadioComponent

Inherits:
Component
  • Object
show all
Includes:
Concerns::CheckboxRadioLabelWithHelpText, Concerns::CheckboxRadioOptions
Defined in:
app/components/pajamas/radio_component.rb

Instance Method Summary collapse

Methods included from Concerns::CheckboxRadioOptions

#formatted_input_options

Methods included from Concerns::CheckboxRadioLabelWithHelpText

#render_label_tag_with_help_text, #render_label_with_help_text

Constructor Details

#initialize(form:, method:, label: nil, help_text: nil, label_options: {}, radio_options: {}, value: nil) ⇒ RadioComponent

Returns a new instance of RadioComponent.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/components/pajamas/radio_component.rb', line 13

def initialize(
  form:,
  method:,
  label: nil,
  help_text: nil,
  label_options: {},
  radio_options: {},
  value: nil
)
  @form = form
  @method = method
  @label_argument = label
  @help_text_argument = help_text
  @label_options = label_options
  @input_options = radio_options
  @value = value
end