dstpierre
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
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
For support of
phoenix_live_viewthere are now two levels of layout theroot_layoutand the existinglayout. This is so that thelayoutpart can be “live” as well. You need to set both tofalseto disable any layout.seva
Anyone landing here from search, this is the code you’ll have to use:
or shorter: