Trying to render an error view:
# in a controller
def test1(conn, params) do
case Repo.get_by(MyModel, title: params["title"]) do
nil ->
put_status(conn, 403)
|> put_layout(false)
|> render(MyAppWeb.ErrorView, "404.html")
# in the config:
debug_errors: false,
Output:
Internal server error
Why? No idea.
And a 2nd question: How can render an error html template with no layout without having to say put_layout(false) from a controller? Namely, I want to set “nil” layout from within ErrorView.






















