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.

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?

On Oct 3, 1:27 am, Pokkai D. [email protected]

On Oct 3, 9:40 am, David [email protected] wrote:

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