Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PersonJsonSerializer
module PersonJsonSerializer
def self.as_json person
if person.errors.present?
person.as_json(:root => "root-attrs")
else
{:errors => person.errors.full_messages}
end
end
end
@tundal45

@vsavkin It seems like the logic here is flipped. If there are errors present, don't you want to returns the error messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.