defmodule <%= inspect Module.concat(@web_module, @resource_alias) %>Live.Show do use <%= @web_module %>, :live_view @impl true def render(assigns) do ~H""" <.header> <%= @resource_human_singular %> <%%= @<%= @resource_singular %>.id %> <:subtitle>This is a <%= @resource_singular %> record from your database. <%= if @update_action do %> <:actions> <.button navigate={~p"<%= @route_prefix %>"}> <.icon name="hero-arrow-left" /> <.button variant="primary" navigate={~p"<%= @route_prefix %>/#{@<%= @resource_singular %>}/edit?return_to=show"}> <.icon name="hero-pencil-square" /> Edit <%= @resource_human_singular %> <% end %> <.list> <%= for attribute <- @attrs do %> <:item title="<%= Phoenix.Naming.humanize(attribute.name) %>"><%%= @<%= @resource_singular %>.<%= attribute.name %> %> <% end %> """ end @impl true def mount(%{"<%= @pkey %>" => <%= @pkey %>}, _session, socket) do {:ok, socket |> assign(:page_title, "Show <%= @resource_human_singular %>") |> assign(:<%= @resource_singular %>, <%= @get_by_pkey %>)} end end