Can you change the @model.errors JSON format?
mrrooijen opened this issue · 1 comments
mrrooijen commented
Hi,
Is it possible to change the @model.errors
JSON format from for example:
{"errors":{"email":["is already taken"]}}
To:
{"email":["is already taken"]}
Thanks!
fabrik42 commented
These messages are generated by Rails through ActiveModel::Errors
, not acts_as_api.
An easy way would be to simply pass @model.errors.to_hash["errors"]
to acts_as_api.