From 60939a304b2eb2087c9cd75cf284d6a952f4170d Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 27 Sep 2024 19:59:15 +0100 Subject: [PATCH] Remove autogenerated home route Renders records instead. --- .../controllers/page_controller.ex | 9 - .../controllers/page_html.ex | 10 - .../controllers/page_html/home.html.heex | 222 ------------------ lib/music_library_web/router.ex | 2 +- .../controllers/page_controller_test.exs | 8 - 5 files changed, 1 insertion(+), 250 deletions(-) delete mode 100644 lib/music_library_web/controllers/page_controller.ex delete mode 100644 lib/music_library_web/controllers/page_html.ex delete mode 100644 lib/music_library_web/controllers/page_html/home.html.heex delete mode 100644 test/music_library_web/controllers/page_controller_test.exs diff --git a/lib/music_library_web/controllers/page_controller.ex b/lib/music_library_web/controllers/page_controller.ex deleted file mode 100644 index 568937ae..00000000 --- a/lib/music_library_web/controllers/page_controller.ex +++ /dev/null @@ -1,9 +0,0 @@ -defmodule MusicLibraryWeb.PageController do - use MusicLibraryWeb, :controller - - def home(conn, _params) do - # The home page is often custom made, - # so skip the default app layout. - render(conn, :home, layout: false) - end -end diff --git a/lib/music_library_web/controllers/page_html.ex b/lib/music_library_web/controllers/page_html.ex deleted file mode 100644 index fb38dc59..00000000 --- a/lib/music_library_web/controllers/page_html.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule MusicLibraryWeb.PageHTML do - @moduledoc """ - This module contains pages rendered by PageController. - - See the `page_html` directory for all templates available. - """ - use MusicLibraryWeb, :html - - embed_templates "page_html/*" -end diff --git a/lib/music_library_web/controllers/page_html/home.html.heex b/lib/music_library_web/controllers/page_html/home.html.heex deleted file mode 100644 index dc1820b1..00000000 --- a/lib/music_library_web/controllers/page_html/home.html.heex +++ /dev/null @@ -1,222 +0,0 @@ -<.flash_group flash={@flash} /> - -
-
- -

- Phoenix Framework - - v<%= Application.spec(:phoenix, :vsn) %> - -

-

- Peace of mind from prototype to production. -

-

- Build rich, interactive web applications quickly, with less code and fewer moving parts. Join our growing community of developers using Phoenix to craft APIs, HTML5 apps and more, for fun or at scale. -

- -
-
diff --git a/lib/music_library_web/router.ex b/lib/music_library_web/router.ex index 68986c12..31363c74 100644 --- a/lib/music_library_web/router.ex +++ b/lib/music_library_web/router.ex @@ -17,9 +17,9 @@ defmodule MusicLibraryWeb.Router do scope "/", MusicLibraryWeb do pipe_through :browser - get "/", PageController, :home get "/images/:record_id", ImageController, :show + live "/", RecordLive.Index, :index live "/records", RecordLive.Index, :index live "/records/import", RecordLive.Index, :import live "/records/:id/edit", RecordLive.Index, :edit diff --git a/test/music_library_web/controllers/page_controller_test.exs b/test/music_library_web/controllers/page_controller_test.exs deleted file mode 100644 index 959fd155..00000000 --- a/test/music_library_web/controllers/page_controller_test.exs +++ /dev/null @@ -1,8 +0,0 @@ -defmodule MusicLibraryWeb.PageControllerTest do - use MusicLibraryWeb.ConnCase - - test "GET /", %{conn: conn} do - conn = get(conn, ~p"/") - assert html_response(conn, 200) =~ "Peace of mind from prototype to production" - end -end