Forum: Ruby on Rails Logout link.....unless logging in!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9f4a65c520a69cd357d830661e172272?d=identicon&s=25 JannaB (Guest)
on 2009-05-19 22:38
(Received via mailing list)
I have a link, /user_session/new, which takes you to a login screen (I
am using AuthLogic plugin) and in my layout template I have....

<div id="Content">
 <%= link_to "Logout", user_session_path, :method => :delete, :confirm
=> "Are you sure you want to logout?" %>
  <%= @content_for_layout %>
 </div>

How can I set this up so that if the url is for the login (i.e.  /
user_session/new) the logout link does not show? Thanks, JannaB
D93ae163042e0a937941e0ba4d8ed5d7?d=identicon&s=25 Eric (Guest)
on 2009-05-19 23:26
(Received via mailing list)
adjust for authlogic:

if current_user.logged_in?
  # logout link
else
  # login/signup links
end
45d6bfd4ad8b10fa5eca787ba0b75e5c?d=identicon&s=25 Ara J (Guest)
on 2009-05-20 09:00
(Received via mailing list)
Ryan Bates to the rescue.  He does a nice screencast on authlogic,
including answering your question.

http://railscasts.com/episodes/160-authlogic

Enjoy
This topic is locked and can not be replied to.