Forum: Ruby on Rails Escaping the AJAX View

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-02-14 22: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
well...
and using the "jumpto" method of capturing they
original URL they requested via request.parameters, and redirecting to
this
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 ?
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-02-17 04:22
(Received via mailing list)
^bump^
337cdd270761e0e6f4356de45b04d388?d=identicon&s=25 Jonathan Viney (jonny)
on 2006-02-17 09: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
end

-Jonny.

Dylan Stamat wrote:
> ^bump^
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-02-17 19: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
RJS.
It works perfectly now.

Thank you, thank you, thank you :)
337cdd270761e0e6f4356de45b04d388?d=identicon&s=25 Jonathan Viney (jonny)
on 2006-02-18 01:46
No problem. RJS is a very powerful tool.

-Jonny.

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