I haven’t used phoenix for some time and the new layouts confuse me:
/layouts
app.html.heex
root.html.heex
From what I remember before, there was the live.html.heex that would be generated for liveview components, however it is not clear on how it works now, because the content from app.html.heex is rendered in dead views too.
All the functionality, which previously required a separate live.html and app.html template was updated with functionality, which works for both codepaths (mostly flash message handling). So there’s simply no longer a need for those separte layout files.
scope "/dashboard", EverlyWeb do
pipe_through [:browser]
live_session :dashboard,
on_mount: [{EverlyWeb.UserAuth, :ensure_authenticated}],
layout: {EverlyWeb.Layouts, :dashboard} do
live "/leads", LeadLive.Index, :index
live "/leads/new", LeadLive.Index, :new
live "/leads/:id/edit", LeadLive.Index, :edit
live "/leads/:id", LeadLive.Show, :show
live "/leads/:id/show/edit", LeadLive.Show, :edit
end
end