Jin Lee
2008-Sep-04 22:26 UTC
Easy way to redirect to "Please Wait" page while JSON request completes?
Hello friends - I have a rails app that uses JSON to send requests to another server. That server processes the request and sends a JSON response back to the rails app. At first I was sending the requests using AJAX but the requests may take up to 30 seconds, and users double-submitted, reloaded, etc. So, I was thinking that upon submitting a request, I could then have rails forward to a "Please wait while we are processing your request" page. From there, rails will send the request and wait for a response. When the response is received (or a timeout of 45 seconds is reached), I can redirect appropriately to the result page. My question is, I am not sure how to achieve this effect of having a "Please wait" page while asynchronously checking another server for a result. Does anyone have any tutorials/advice/links on how to achieve this? Alternatively, I have seen (using prototype or jquery) sites where when you press the submit button, the screen greys out and a window is tiled on top informing the user that the request is being processed. Is it possible to utilize this method using ajax? Thanks, Jin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maurício Linhares
2008-Sep-04 22:30 UTC
Re: Easy way to redirect to "Please Wait" page while JSON request completes?
You can just use a loading panel (that is also modal) to keep the user from double submiting -> http://thecodecentral.com/2008/01/17/a-yui-loading-panel-widget On Thu, Sep 4, 2008 at 7:26 PM, Jin Lee <jinslee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello friends - > > I have a rails app that uses JSON to send requests to another server. That > server processes the request and sends a JSON response back to the rails > app. > > At first I was sending the requests using AJAX but the requests may take up > to 30 seconds, and users double-submitted, reloaded, etc. So, I was thinking > that upon submitting a request, I could then have rails forward to a "Please > wait while we are processing your request" page. From there, rails will send > the request and wait for a response. When the response is received (or a > timeout of 45 seconds is reached), I can redirect appropriately to the > result page. > > My question is, I am not sure how to achieve this effect of having a "Please > wait" page while asynchronously checking another server for a result. Does > anyone have any tutorials/advice/links on how to achieve this? > > Alternatively, I have seen (using prototype or jquery) sites where when you > press the submit button, the screen greys out and a window is tiled on top > informing the user that the request is being processed. Is it possible to > utilize this method using ajax? > > Thanks, > Jin > > > >-- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---