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 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/8f69ca19/attachment.html
^bump^ On 2/14/06, Dylan Stamat <dylans@gmail.com> wrote:> > 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 ? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/92c4040c/attachment.html
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^-- Posted via http://www.ruby-forum.com/.
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 :) On 2/17/06, Jonathan Viney <jviney@spreydon.org.nz> wrote:> > 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^ > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/5ac8625f/attachment.html