Rails displays all validation error messages associated with a given field. If I have three validates_XXXXX_of :email, and I leave the field blank, I get three
Add a method to ActiveModel::Errors class
module ActiveModel
class Errors
def full_unique_messages
unique_messages = messages.map { |attribute, list_of_messages| [attribute, list_of_messages.first] }
unique_messages.map { |attribute_message_pair| full_message *attribute_message_pair }
end
end
end
Add it to a file, like lib/core_ext/rails/active_model/errors.rb. Create a file config/initializers/core_ext.rb and add a require "core_ext/rails/active_model/errors.rb" to it.