Skip to content

Commit

Permalink
Refactor layouts and controllers naming
Browse files Browse the repository at this point in the history
  • Loading branch information
gcauchon committed Jun 21, 2023
1 parent 27dbdc9 commit ab5691d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/elixir_boilerplate_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule ElixirBoilerplateWeb do
use Phoenix.Controller,
namespace: ElixirBoilerplateWeb,
formats: [:html, :json],
layouts: [html: ElixirBoilerplateWeb.Components.Layouts]
layouts: [html: ElixirBoilerplateWeb.Layouts]

import Plug.Conn
import ElixirBoilerplate.Gettext
Expand All @@ -52,7 +52,7 @@ defmodule ElixirBoilerplateWeb do
def live_view do
quote do
use Phoenix.LiveView,
layout: {ElixirBoilerplateWeb.Components.Layouts, :app}
layout: {ElixirBoilerplateWeb.Layouts, :app}

unquote(html_helpers())
end
Expand Down
5 changes: 0 additions & 5 deletions lib/elixir_boilerplate_web/components/layouts.ex

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule ElixirBoilerplateWeb.Controllers.Page do
defmodule ElixirBoilerplateWeb.Controllers.LandingPage do
use ElixirBoilerplateWeb, :controller

@spec home(Plug.Conn.t(), map) :: Plug.Conn.t()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule ElixirBoilerplateWeb.Controllers.PageHTML do
defmodule ElixirBoilerplateWeb.Controllers.LandingPageHTML do
use ElixirBoilerplateWeb, :html

attr :message, :string, default: nil
Expand Down
5 changes: 5 additions & 0 deletions lib/elixir_boilerplate_web/layouts/layouts.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule ElixirBoilerplateWeb.Layouts do
use ElixirBoilerplateWeb, :html

embed_templates "templates/*"
end
4 changes: 2 additions & 2 deletions lib/elixir_boilerplate_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule ElixirBoilerplateWeb.Router do
plug(:protect_from_forgery)
plug(ElixirBoilerplateWeb.Plugs.Security)

plug(:put_root_layout, html: {ElixirBoilerplateWeb.Components.Layouts, :root})
plug(:put_root_layout, html: {ElixirBoilerplateWeb.Layouts, :root})
end

pipeline :api do
Expand All @@ -20,7 +20,7 @@ defmodule ElixirBoilerplateWeb.Router do
scope "/", ElixirBoilerplateWeb do
pipe_through :browser

get("/", Controllers.Page, :home)
get("/", Controllers.LandingPage, :home)
end

scope "/api" do
Expand Down

0 comments on commit ab5691d

Please sign in to comment.