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
adjust for authlogic: if current_user.logged_in? # logout link else # login/signup links end On May 19, 1:36 pm, JannaB <mistressja...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> 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
Ryan Bates to the rescue. He does a nice screencast on authlogic, including answering your question. http://railscasts.com/episodes/160-authlogic Enjoy On May 19, 4:36 pm, JannaB <mistressja...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> 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