Module: BootstrapForm::CheckBoxPatch
- Defined in:
- lib/bootstrap_form/check_box_patch.rb
Instance Method Summary collapse
-
#check_box(name, options = {}, checked_value = "1", unchecked_value = "0", &block) ⇒ Object
TODO: check upstream - it is on master on 29-1-2018 - only required is not there.
Instance Method Details
#check_box(name, options = {}, checked_value = "1", unchecked_value = "0", &block) ⇒ Object
TODO: check upstream - it is on master on 29-1-2018 - only required is not there
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bootstrap_form/check_box_patch.rb', line 5 def check_box(name, = {}, checked_value = "1", unchecked_value = "0", &block) = .symbolize_keys! = .except(:label, :label_class, :wrapper_class, :help, :inline) label_classes = [[:label_class], 'form-check-label'] unless .delete(:skip_required) label_classes << "required" if required_attribute?(object, name) end [:label_class] = label_classes.compact.join(' ') super end |