fabrik42/acts_as_api

Can you change the @model.errors JSON format?

mrrooijen opened this issue · 1 comments

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!

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.