Forum: Ruby on Rails Catching 302 link_to_remote

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fredrik T. (Guest)
on 2006-01-24 19:06
I'm having trouble catching a 302 with link_to_remote.

The redirect is issued if the user is not logged in with the before
In the lighty log i see the 302 scroll by and then it renders the login
screen with a 200. That 200, I can catch and issue a redirect (just for

Any ideas on where I go wrong?

<%= link_to_remote("Link name",
          :url =>{ :controller => "hotlist", :action => "save" },
          302 =>
"document.location=request.getResponseHeader('location')") %>

200 => "alert('Hello')" Works

Lighty log for one request

Processing HotlistController#save (for at 2006-01-23 23:04:09)
  Session ID: 730985b6fffc3a5fd8eb519e884a21c7
  Parameters: {"action"=>"save", "controller"=>"hotlist"}
Redirected to http://hostname:3000/account/login
Completed in 0.00885 (113 reqs/sec) | DB: 0.03072 (347%) | 302 Found
  Hotlist Columns (0.012841)   SHOW FIELDS FROM hotlists
  Listing Columns (0.016885)   SHOW FIELDS FROM listings

Processing AccountController#login (for at 2006-01-23 23:04:10)
  Session ID: 730985b6fffc3a5fd8eb519e884a21c7
  Parameters: {"action"=>"login", "controller"=>"account"}
Rendering  within layouts/layout
Rendering account/login
Rendered hotlist/_mini (0.01394)
Completed in 0.04122 (24 reqs/sec) | Rendering: 0.03281 (79%) | DB:
0.02973 (72%) | 200 OK [http://hostname/account/login]

This topic is locked and can not be replied to.