Module: Html5Validators::ActionViewExtension::FormHelper
- Defined in:
- lib/html5_validators/action_view/form_helpers.rb
Instance Method Summary collapse
- #form_for(record, options = {}, &block) ⇒ Object
- #form_with(model: nil, scope: nil, url: nil, format: nil, **options) ⇒ Object
Instance Method Details
#form_for(record, options = {}, &block) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/html5_validators/action_view/form_helpers.rb', line 6 def form_for(record, = {}, &block) if record.respond_to?(:auto_html5_validation=) if !Html5Validators.enabled || ([:auto_html5_validation] == false) record.auto_html5_validation = false end end super end |
#form_with(model: nil, scope: nil, url: nil, format: nil, **options) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/html5_validators/action_view/form_helpers.rb', line 16 def form_with(model: nil, scope: nil, url: nil, format: nil, **) if model && model.respond_to?(:auto_html5_validation=) if !Html5Validators.enabled || ([:auto_html5_validation] == false) model.auto_html5_validation = false end end super end |