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>
|
||||
<a href="<%= page_path @conn, :index, 1 %>">Go away</a>.
|
||||
<a href="<%= home_url %>">Go away</a>.
|
||||
</p>
|
||||
</div>
|
|
@ -1,6 +1,8 @@
|
|||
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}
|
||||
end
|
||||
|
@ -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
|
||||
|
|
Reference in a new issue