Refer to home url in error view
This commit is contained in:
parent
6196309619
commit
4e8ac4624b
2 changed files with 8 additions and 1 deletions
|
@ -6,6 +6,6 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="<%= page_path @conn, :index, 1 %>">Go away</a>.
|
<a href="<%= home_url %>">Go away</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
|
@ -1,6 +1,8 @@
|
||||||
defmodule MebeWeb.ErrorView do
|
defmodule MebeWeb.ErrorView do
|
||||||
use MebeWeb.Web, :view
|
use MebeWeb.Web, :view
|
||||||
|
|
||||||
|
@absolute_url Application.get_env(:blog_config, :absolute_url)
|
||||||
|
|
||||||
def render("404.html", %{conn: conn}) do
|
def render("404.html", %{conn: conn}) do
|
||||||
render "not_found.html", %{conn: conn}
|
render "not_found.html", %{conn: conn}
|
||||||
end
|
end
|
||||||
|
@ -14,4 +16,9 @@ defmodule MebeWeb.ErrorView do
|
||||||
def template_not_found(_template, assigns) do
|
def template_not_found(_template, assigns) do
|
||||||
render "500.html", assigns
|
render "500.html", assigns
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Get the home page URL of the site.
|
||||||
|
"""
|
||||||
|
def home_url(), do: @absolute_url
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue