Refer to home url in error view

This commit is contained in:
Mikko Ahlroth 2015-09-13 19:48:04 +03:00
parent 6196309619
commit 4e8ac4624b
2 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,6 @@
</p>
<p>
<a href="<%= page_path @conn, :index, 1 %>">Go away</a>.
<a href="<%= home_url %>">Go away</a>.
</p>
</div>

View file

@ -1,5 +1,7 @@
defmodule MebeWeb.ErrorView do
use MebeWeb.Web, :view
@absolute_url Application.get_env(:blog_config, :absolute_url)
def render("404.html", %{conn: conn}) do
render "not_found.html", %{conn: conn}
@ -14,4 +16,9 @@ defmodule MebeWeb.ErrorView do
def template_not_found(_template, assigns) do
render "500.html", assigns
end
@doc """
Get the home page URL of the site.
"""
def home_url(), do: @absolute_url
end