Forum: Ruby on Rails Escaping the AJAX View

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.
Dylan S. (Guest)
on 2006-02-14 23:14
(Received via mailing list)
I have a login form, in which I use a "form_remote_tag".
I'm redirecting users to this form when they fail authentication as
and using the "jumpto" method of capturing they
original URL they requested via request.parameters, and redirecting to
URL after they authenticate.

Problem is, if I try to do a "redirect_to", this won't work, as I'm
still in
the AJAX request.

I'm assuming my only alternatives are:
1)  Not use AJAX
2)  Send un-authenicated users to a different non-ajaxed login form.
3)  Parse the request.parameters, then pass the URL as a variable into a
template which then does a window.location redirect.

Any other ideas ?
Dylan S. (Guest)
on 2006-02-17 05:22
(Received via mailing list)
Jonathan V. (Guest)
on 2006-02-17 10:24
You can use RJS to redirect the user. In the action you can do...

render :update do |page|
  page.redirect_to :action => :my_action


Dylan S. wrote:
> ^bump^
Dylan S. (Guest)
on 2006-02-17 20:07
(Received via mailing list)
Genius, thanks Jonathan :)
My fear of RJS templates has been vanquished !  Edge demons be gone !!

It took me literally 10 minutes to switch out a complex form over to
It works perfectly now.

Thank you, thank you, thank you :)
Jonathan V. (Guest)
on 2006-02-18 02:46
No problem. RJS is a very powerful tool.


Dylan S. wrote:
> Thank you, thank you, thank you :)
This topic is locked and can not be replied to.