Module: Html5Validators::ActionViewExtension::PresenceValidator

Included in:
ActionView::Helpers::Tags::TextArea, ActionView::Helpers::Tags::TextField
Defined in:
lib/html5_validators/action_view/form_helpers.rb

Instance Method Summary collapse

Instance Method Details

#renderObject



15
16
17
18
19
20
# File 'lib/html5_validators/action_view/form_helpers.rb', line 15

def render
  if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    @options["required"] ||= @options[:required] || object.class.attribute_required?(@method_name)
  end
  super
end