Module: Html5Validators::ActionViewExtension::LengthValidator
- Defined in:
- lib/html5_validators/action_view/form_helpers.rb
Instance Method Summary collapse
Instance Method Details
#render ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/html5_validators/action_view/form_helpers.rb', line 24 def render if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false) @options["maxlength"] ||= @options[:maxlength] || object.class.attribute_maxlength(@method_name) @options["minlength"] ||= @options[:minlength] || object.class.attribute_minlength(@method_name) end super end |