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



28
29
30
31
32
33
# File 'lib/html5_validators/action_view/form_helpers.rb', line 28

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