Module: StimulusPlumbers::Form::Fields::Inputs::Checkbox
- Included in:
- Builder
- Defined in:
- lib/stimulus_plumbers/form/fields/inputs/checkbox.rb
Instance Method Summary collapse
- #check_box(attribute, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
- #collection_check_boxes(attribute, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
Instance Method Details
#check_box(attribute, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
8 9 10 11 |
# File 'lib/stimulus_plumbers/form/fields/inputs/checkbox.rb', line 8 def check_box(attribute, = {}, checked_value = "1", unchecked_value = "0") = (theme.resolve(:form_field_input_checkbox), ) super(attribute, , checked_value, unchecked_value) end |
#collection_check_boxes(attribute, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stimulus_plumbers/form/fields/inputs/checkbox.rb', line 13 def collection_check_boxes( attribute, collection, value_method, text_method, = {}, = {}, &block ) item_opts = (theme.resolve(:form_field_input_checkbox), ) if block_given? super(attribute, collection, value_method, text_method, , item_opts, &block) else super(attribute, collection, value_method, text_method, , item_opts) do |builder| render_check_box_label(builder, theme.resolve(:form_field_checkbox_label)) end end end |