I have the following snippet of code that creates a list of navigation items (a menu):
<ul class="nav">
<li><%= link_to "Log in", login_path %></li>
<li><%= link_to "Help", help_path %></li>
<% if logged_in? %>
<li><%= link_to "Home", root_path %></li>
</ul>
When I am not logged in, the menu shows as:
Log in
Help
When I do log in, it shows as
Log in
Help
Home
After logging in, I'd like to:
- hide or remove the
log in
menu item and - rearrange the remainder menu items so that
Home
is first andHelp
is next.