Skip to content

Commit 21f72f3

Browse files
committed
Simplify ShowLive to avoid handle_params
1 parent 0079ad0 commit 21f72f3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

priv/templates/phx.gen.live/show.ex

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
2727
end
2828

2929
@impl true
30-
def mount(_params, _session, socket) do
31-
{:ok, socket}
32-
end
33-
34-
@impl true
35-
def handle_params(%{"id" => id}, _, socket) do
36-
{:noreply,
37-
socket
30+
def mount(%{"id" => id}, _session, socket) do
31+
{:ok, socket
3832
|> assign(:page_title, "Show <%= schema.human_singular %>")
3933
|> assign(:<%= schema.singular %>, <%= inspect context.alias %>.get_<%= schema.singular %>!(id))}
4034
end

0 commit comments

Comments
 (0)