Module: Trestle::Form::Fields::CheckBoxHelpers
- Included in:
- CheckBox, CollectionCheckBoxes
- Defined in:
- lib/trestle/form/fields/check_box_helpers.rb
Instance Method Summary collapse
- #default_wrapper_class ⇒ Object
- #defaults ⇒ Object
- #inline? ⇒ Boolean
- #input_class ⇒ Object
- #label_class ⇒ Object
- #switch? ⇒ Boolean
Instance Method Details
#default_wrapper_class ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 13 def default_wrapper_class [ "form-check", ("form-switch" if switch?), ("form-check-inline" if inline?) ].compact end |
#defaults ⇒ Object
29 30 31 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 29 def defaults Trestle::Options.new(disabled: readonly?) end |
#inline? ⇒ Boolean
9 10 11 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 9 def inline? [:inline] end |
#input_class ⇒ Object
21 22 23 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 21 def input_class ["form-check-input"] end |
#label_class ⇒ Object
25 26 27 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 25 def label_class ["form-check-label"] end |
#switch? ⇒ Boolean
5 6 7 |
# File 'lib/trestle/form/fields/check_box_helpers.rb', line 5 def switch? [:switch] end |