I’m trying to figure out where the default “app.html.eex” file is defined in all the pipeline.
The better I managed to find is the following explanation on the Phoenix Controller part of the documentation:
defmodule MyAppWeb.UserController do use Phoenix.Controller def show(conn, _params) do render(conn, "show.html", message: "Hello") end end
will render the “show.html” template inside an “app.html” template specified in
However I wasn’t able to find the exact part in the source code where this is happening.
I tried by renaming the file (for example
ap.html.eex which it gives me an error) to follow the stack trace to find where the default layout is applied.
I also tried to figure out where the
app.html.eex template is injected by putting many
IO.inpsect(template) all over the source code of Phoenix around the
renders functions where things seem to happen… But without success…
I also read in Chris’ book (Programming Phoenix) the following (on page 57):
When you call render in your controller, you’re actu-
ally rendering with the :layout option set by default. This allows you to render
the view and template for your controller action in the layout with a plain
render function call. No magic is happening here.
To be honest it is like magic for me…
Any details will be appreciated!