Class: ActionView::Helpers::Tags::TextField

Inherits:
Object
  • Object
show all
Defined in:
lib/html5_validators/action_view/form_helpers.rb

Instance Method Summary collapse

Instance Method Details

#render_with_html5_attributesObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/html5_validators/action_view/form_helpers.rb', line 35

def render_with_html5_attributes
  inject_required_field
  inject_maxlength_field

  if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    @options["max"] ||= object.class.attribute_max(@method_name)
    @options["min"] ||= object.class.attribute_min(@method_name)
  end
  render_without_html5_attributes
end