Exceptional v1.5.2 Exceptional.Phoenix.ViewHelper
Helpers for working with Phoenix views
Summary
Macros
Same as defrender/2
, but with a format whitelist (ex. only: [:json]
)
Types
Functions
Generate a single error hander
Examples
iex> render(:error, for: 404, format: :json, do: "Oh no!")
{
:def,
[context: Exceptional.Phoenix.ViewHelper, import: Kernel],
[
{
:render,
[context: Exceptional.Phoenix.ViewHelper],
[
"404.json",
{:error_info, [], Exceptional.Phoenix.ViewHelper}
]
},
[do: {
:render, [], [
{
:<<>>, [], [
{
:::,
[],
[
{
{:., [], [Kernel, :to_string]},
[],
[:json]
},
{:binary, [], Exceptional.Phoenix.ViewHelper}
]
}
]
},
"Oh no!",
{:error_info, [], Exceptional.Phoenix.ViewHelper}
]
}]
]
}
Macros
Same as defrender/2
, but with a format whitelist (ex. only: [:json]
)