method
to_hash
rails latest stable - Class:
ActiveModel::Errors
to_hash(full_messages = false)public
Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).
person.errors.to_hash # => {:name=>["cannot be nil"]} person.errors.to_hash(true) # => {:name=>["name cannot be nil"]}