Adding the logout link


Our users love us, they like creating, deleting and updating posts. While we'd like them to stay permanently on the website, they may want to be able to quit the app.

So let's give them a log out link. This is easy – put the following code in your index.html.erb, below the <%=link_to("Create a new post", new_post_path) %> line:

<%= link_to('Logout', destroy_user_session_path, method: :delete) %>

Devise knows how to handle the rest, so our work is done.

Check it out!

results matching ""

    No results matching ""