class ActiveModel::Errors
def attribute_names
person.errors.messages # => {:name=>["cannot be nil", "must be specified"]}
Returns all error attribute names
def attribute_names @errors.map(&:attribute).uniq.freeze end
def attribute_names @errors.map(&:attribute).uniq.freeze end