eview v0.10.8 EView.Views.ValidationError

This module provides renders that can be used whenever you want to show validation error.

Example:

changeset = %SampleSchema{}
|> SampleSchema.changeset(params)

case changeset.valid? do
  true ->
    conn
    |> put_status(200)
    |> render("page.json", map_keys_to_atom(params))
  _ ->
    conn
    |> put_status(422)
    |> render(EView.Views.ValidationError, "422.json", changeset)
end

Summary

Functions

render(binary, ch)

Render a JSON Schema validation error.

render(binary, changeset, entry_type)