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 192.168.71.2 at 2008-10-07
20:22:14) [POST]
  Session ID:
BAh7CDoMY3NyZl9pZCIlZmYyODM1OGM3OGM5ODA5NThhYWM0MDIwMGM0Y2E3
ZDg6DHVzZXJfaWRpByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxh
c2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==--8a4d25e872b1a1d27e663069f94087a6245f75aa
  Parameters:
{"authenticity_token"=>"2f8d0d7adeea4495c27d1c045a14675dad7294f8",
"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