diff --git a/priv/templates/phx.gen.live/show.ex b/priv/templates/phx.gen.live/show.ex index 445a66fc07..46379eb698 100644 --- a/priv/templates/phx.gen.live/show.ex +++ b/priv/templates/phx.gen.live/show.ex @@ -27,13 +27,8 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web end @impl true - def mount(_params, _session, socket) do - {:ok, socket} - end - - @impl true - def handle_params(%{"id" => id}, _, socket) do - {:noreply, + def mount(%{"id" => id}, _session, socket) do + {:ok, socket |> assign(:page_title, "Show <%= schema.human_singular %>") |> assign(:<%= schema.singular %>, <%= inspect context.alias %>.get_<%= schema.singular %>!(id))}