Login and logout doesn't work in different actions

Hi,I am trying to create a user autentication system. Normally the
user autentication system works fine but now i want to include the
login and logout in the header of the application. so that u can login
and logout in any part of the application

this it the weird part of the problem. let's say i am in articles/
search then i login and logout there is no problem. but when i go to
articles/show i get

Sorry the error that i get should be like this:
Processing ArticlesController#7 (for at 2008-10-07
20:22:14) [POST]
  Session ID:
"action"=>"7", "controller"=>"articles"}

ActionController::UnknownAction (No action responded to 7):

after more inspection i have found that it is the link_to_remote that
has lost its :url. it seems to be picking up the url of the action
page. Does anyone know why?

Never mind i figured it out