Class: Pajamas::CheckboxComponent
- Includes:
- Pajamas::Concerns::CheckboxRadioLabelWithHelpText, Pajamas::Concerns::CheckboxRadioOptions
- Defined in:
- app/components/pajamas/checkbox_component.rb
Instance Method Summary collapse
-
#initialize(form:, method:, label: nil, help_text: nil, label_options: {}, checkbox_options: {}, content_wrapper_options: {}, checked_value: '1', unchecked_value: '0') ⇒ CheckboxComponent
constructor
A new instance of CheckboxComponent.
Methods included from Pajamas::Concerns::CheckboxRadioOptions
Methods included from Pajamas::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: {}, checkbox_options: {}, content_wrapper_options: {}, checked_value: '1', unchecked_value: '0') ⇒ CheckboxComponent
Returns a new instance of CheckboxComponent.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/components/pajamas/checkbox_component.rb', line 16 def initialize( form:, method:, label: nil, help_text: nil, label_options: {}, checkbox_options: {}, content_wrapper_options: {}, checked_value: '1', unchecked_value: '0' ) @form = form @method = method @label_argument = label @help_text_argument = help_text @label_options = @input_options = @content_wrapper_options = @checked_value = checked_value @unchecked_value = unchecked_value @value = checked_value if [:multiple] end |