vt-elixir / ja_resource

A behaviour to reduce boilerplate code in your JSON-API compliant Phoenix controllers without sacrificing flexibility.
Other
113 stars 33 forks source link

How to return validation errors from `handle_update/3`? #64

Closed nathanl closed 7 years ago

nathanl commented 7 years ago

In the README, for handle_update/3 it says:

If this function returns a changeset it will be inserted and errors rendered if required. It may also return a model or validation errors for rendering or a %Plug.Conn{} for total rendering control.

Can someone give an example of returning validation errors?