vendor/rails/activerecord/lib/active_record/validations.rb
# Returns all the full error messages in an array.
#
#   class Company < ActiveRecord::Base
#     validates_presence_of :name, :address, :email
#     validates_length_of :name, :in => 5..30
#   end
#
#   company = Company.create(:address => '123 First St.')
#   company.errors.full_messages # =>
#     ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Address can't be blank"]
Returns all the full error messages in an array.


Returns all the full error messages in an array .
def full_messages(options = {})
      full_messages = []
      @errors.each_key do |attr|
        @errors[attr].each do |message|
          next unless message
          if attr == "base"
            full_messages << message
          else
            attr_name = @base.class.human_attribute_name(attr)
            full_messages << attr_name + ' ' + message
          end
        end
      end
      full_messages
    end
def full_messages ( options = { } ) full_messages = [ ] @errors . each_key do | attr | @errors [ attr ] . each do | message | next unless message if attr == "base" full_messages << message else attr_name = @base . class . human_attribute_name ( attr ) full_messages << attr_name + ' ' + message end end end full_messages end
Returns all the full error messages in an array.
Returns all the full error messages in an array .
#key = :"activerecord.att.#{@base.class.name.underscore.to_sym}.#{attr}" 
options