Do not show a 'Log out' link when the user is not logged in.
authorWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 02:06:45 +0000 (21:06 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 02:06:45 +0000 (21:06 -0500)
app/views/layouts/application.html.erb

index 174b7718b5eb64bd1c993f2600455876e2240c46..7aa06aebd5bfca30d616058bf8ff6e60af83fc56 100644 (file)
            <% end %>
          </ul>
          <ul class="nav pull-right">
+      <% if current_user -%>
             <li><a href="<%= logout_path %>">Log out</a></li>
+      <% else -%>
+            <li><a href="<%= root_path %>">Log in</a></li>
+      <% end -%>
           </ul>
         </div><!--/.nav-collapse -->
       </div>