Skip to content

Commit bd589f1

Browse files
authored
Simplify ShowLive to avoid handle_params (#6059)
* Simplify ShowLive to avoid handle_params * mix format
1 parent 042ce91 commit bd589f1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

+2-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +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,
30+
def mount(%{"id" => id}, _session, socket) do
31+
{:ok,
3732
socket
3833
|> assign(:page_title, "Show <%= schema.human_singular %>")
3934
|> assign(:<%= schema.singular %>, <%= inspect context.alias %>.get_<%= schema.singular %>!(id))}

0 commit comments

Comments
 (0)