diff --git a/lib/algora_web/controllers/error_html.ex b/lib/algora_web/controllers/error_html.ex index eed5d015..4741651b 100644 --- a/lib/algora_web/controllers/error_html.ex +++ b/lib/algora_web/controllers/error_html.ex @@ -1,18 +1,8 @@ defmodule AlgoraWeb.ErrorHTML do use AlgoraWeb, :html - # If you want to customize your error pages, - # uncomment the embed_templates/1 call below - # and add pages to the error directory: - # - # * lib/algora_web/controllers/error_html/404.html.heex - # * lib/algora_web/controllers/error_html/500.html.heex - # - # embed_templates "error_html/*" + embed_templates "error_html/*" - # The default is to render a plain text page based on - # the template name. For example, "404.html" becomes - # "Not Found". def render(template, _assigns) do Phoenix.Controller.status_message_from_template(template) end diff --git a/lib/algora_web/controllers/error_html/404.html.heex b/lib/algora_web/controllers/error_html/404.html.heex new file mode 100644 index 00000000..61ae7a0f --- /dev/null +++ b/lib/algora_web/controllers/error_html/404.html.heex @@ -0,0 +1,234 @@ + + + + + + 404 - Page Not Found + + + +
+
+
+
+
+
+
+ +
+
404
+

This page could not be found

+

+ Sorry, the page you're looking for doesn't exist or has been moved. +

+ <.link navigate="/" class="home-button"> + + + + Go back home + +
+ + diff --git a/test/algora_web/controllers/error_html_test.exs b/test/algora_web/controllers/error_html_test.exs index cb349cd0..de705a19 100644 --- a/test/algora_web/controllers/error_html_test.exs +++ b/test/algora_web/controllers/error_html_test.exs @@ -5,7 +5,7 @@ defmodule AlgoraWeb.ErrorHTMLTest do import Phoenix.Template test "renders 404.html" do - assert render_to_string(AlgoraWeb.ErrorHTML, "404", "html", []) == "Not Found" + assert render_to_string(AlgoraWeb.ErrorHTML, "404", "html", []) =~ "could not be found" end test "renders 500.html" do