Doing redirection on a remote call to a function

You can specify Javascript callbacks for the various phases of the remote call and also for specific response status or status codes (see the doc for link_to_remote at ; remote_function takes the same arguments).

So it might be something like this (off the top of my head):

remote_function( :update => "subcat", :url => { :controller =>
"categories", :action => "get_subcategories"}, :position => "replace",
:with => "'category_id='+this.value", 302 => "handleRedirection(request)" )

where handleRedirection() is a Javascript function you've written to do the redirection (I'm assuming the response Lcation: header is available there, but haven't checked).



Charanya Nagarajan wrote:

Thanks Denis..
this really helped...