Hi,
Retrying Elixir for the 4th time in the last 3 years, I think this time will be the “good” one.
So I’m still just playing around, and would need an explanation about why a fresh controller with the following action:
def index(conn, params) do
conn
|> put_layout(false)
|> render("index.html", params: params)
end
I would expect my HTML from my templates/[controller-name]/index.html.eex to be the only HTML.
Instead it’s wrapped in what appears to be the root.html from templates/layout/root.leex.
When I remove the put_layout(false)
I’m getting wrapped inside the app.html.eex
layout, which is also wrapped in what appears to be root.html.leex
.
Looking around for where this supposedly root.html
would be set, and I’m not finding anything in “my” code, so I suspect this might be inside Phoenix, not really ready to dive into the source code yet, just prototyping.
From the documentation it seems the put_layout(false)
should be the way to go to remove the layout template.
Any pointer would be appreciated.
Thanks