O'Reilly logo

Programming Phoenix by Jose Valim, Bruce Tate, Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Presenting User Account Links

We’ve come a long way. We can now authenticate a user in a secure way. We’re using a single function that we can reliably share across each feature of the application that needs it. Now, we can turn our attention to showing customized headers in our layout based on a user’s authentication status. Let’s start with a welcome message and a logout link.

We want to change the layout of the application to handle the new user features so that other views can also take advantage of these features. Let’s update the layout in web/templates/layout/app.html.eex. Change it to look like this:

 <div class=​"header"​>
  <ol class=​"breadcrumb text-right"​>

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required