Javascript/Prototype helper and redirect_to

Is there a Javascript/Prototype helper with which you can use redirect_to? Ive been searching all around and can't seem to find any information about this. I need to use an ajax helper to send data from a javascript function. I have been using link_to_remote and passing the data like so: :with => "'data='+newFunction()". But by using link_to_remote, I am unable to redirect to another action, which is somewhat limiting. Any input is appreciated. Thanks.

The magic page object has a method for this, funnily enough it's called redirect_to

Fred

David wrote:

Is there a Javascript/Prototype helper with which you can use redirect_to? Ive been searching all around and can't seem to find any information about this. I need to use an ajax helper to send data from a javascript function. I have been using link_to_remote and passing the data like so: :with => "'data='+newFunction()". But by using link_to_remote, I am unable to redirect to another action, which is somewhat limiting. Any input is appreciated. Thanks.

there is no redirect_to helper for Ajax environment

you can use     link_to_remote "Delete", :update => "div_id",          :url => {:controller=>'',:action=>''}, :method => :delete,          :html => { :class => "divs" } or link_to_remote "Delete", :update => "div_id", :url => { :action => "", :id => @id }

So is there any way to pass the result of a javascript function to an action in order to save information to the database and then use redirect_to?

So is there any way to pass the result of a javascript function to an action in order to save information to the database and then use redirect_to?

The below information is wrong. When using rjs you can redirect (but you need to use page.redirect_to, not redirect_to)

Fred

Okay, I will look into that. Thanks.