class ActiveModel::Errors
def group_by_attribute
person.errors.group_by_attribute
Returns a Hash of attributes with an array of their Error objects.
def group_by_attribute @errors.group_by(&:attribute) end
def group_by_attribute @errors.group_by(&:attribute) end