Root Layout is bumming me out


I have upgraded to latest live_view and have added in the root layout.

In the previous version of my application the app.html.eex was the default layout and had all of the navigation and a menu for the @conn.assigns.current_user. When the User signed out I took them to the login page and applied a new layout called blank.html.eex.

When I added a live_view route I added in the root.html.eex layout, however if I leave the user menu in the root.html.eex my login page fails because I can’t change the root.html.eex in the controller and there is no @conn.assigns.current_user available.

If I move the navigation and menu to the app.html.eex and use a live.html.leex for the live_view I lose all of the navigation.

I don’t want to have to duplicate the navigation in the live.html.leex but can’t seem to wrap my head around how to make it all work.

Any help will be appreciated.


I am not sure if it is the correct way to do it but I decided to remove the blank.html.eex layout and tested for a current user in the root.html.ex