Weird layout
I started a little Phoenix-project. But the layout of that project's main page looked weird. Using the layout solved the issue.
Instead of just reading more guides and more books, I finally started to work on a little side project using Elixir and Phoenix. After running mix phx.new
I added some contexts and schemas and views and controllers and edited page_html/home.html.heex
, the homepage.
But unlike the generated views, it still looked odd and I couldn't figure out why. I wanted it to be layouted like the other pages but somehow it wasn't. Was it because I still have to learn more tailwindcss? Then I saw this comment in PageController
:
Removing layout: false
did the trick. Why? I don't know, it seems to be missing in the documentation. I think it might have to do something with the private assigns_layout/2
in Phoenix.Controller
.
Anyway. Now my homepage uses the root
and app
-layout like all the other views. Like it's supposed to.