Module: Trestle::Form::Fields::RadioButtonHelpers
- Included in:
- CollectionRadioButtons, RadioButton
- Defined in:
- lib/trestle/form/fields/radio_button_helpers.rb
Instance Method Summary collapse
- #custom? ⇒ Boolean
- #default_wrapper_class ⇒ Object
- #inline? ⇒ Boolean
- #input_class ⇒ Object
- #label_class ⇒ Object
Instance Method Details
#custom? ⇒ Boolean
5 6 7 |
# File 'lib/trestle/form/fields/radio_button_helpers.rb', line 5 def custom? [:custom] != false end |
#default_wrapper_class ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/trestle/form/fields/radio_button_helpers.rb', line 13 def default_wrapper_class if custom? [ "custom-control", "custom-radio", ("custom-control-inline" if inline?) ].compact else [ "form-check", ("form-check-inline" if inline?) ].compact end end |
#inline? ⇒ Boolean
9 10 11 |
# File 'lib/trestle/form/fields/radio_button_helpers.rb', line 9 def inline? [:inline] end |
#input_class ⇒ Object
28 29 30 |
# File 'lib/trestle/form/fields/radio_button_helpers.rb', line 28 def input_class custom? ? ["custom-control-input"] : ["form-check-input"] end |
#label_class ⇒ Object
32 33 34 |
# File 'lib/trestle/form/fields/radio_button_helpers.rb', line 32 def label_class custom? ? ["custom-control-label"] : ["form-check-label"] end |