# Javascript (or otherwise) "Waiting" page?

**URL:** <https://www.ruby-forum.com/t/javascript-or-otherwise-waiting-page/140724>\
**Category:** Rails\
**Created:** [June 17, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/javascript-or-otherwise-waiting-page/140724 "2008-06-17T23:32:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dezrtdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Post date:** [June 17, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/javascript-or-otherwise-waiting-page/140724/1 "2008-06-17T23:32:15Z")

</div>

Hi All,

I’m trying to figure out the best of a million ways to generate a  
waiting page. For instance, if I have administrators waiting to  
approve “Posts” that are in queue, and there are currently no “Posts”  
waiting to be approved, I’d like them to be sent to a “Waiting” page  
until more are available then refresh every few seconds and Javascript  
redirect them to the “Approval” page once more are available.

Is this a reasonable enough request? How would I go about it?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dezrtdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Post date:** [June 17, 2008, 11:36pm UTC](https://www.ruby-forum.com/t/javascript-or-otherwise-waiting-page/140724/2 "2008-06-17T23:36:25Z")

</div>

On 17 Jun 2008, at 22:31, gberz3 wrote:

> Is this a reasonable enough request? How would I go about it?

You could easily enough have a periodically\_call\_remote that would  
poll some url. when the time is right have that page render  
page.redirect\_to :action =\> ‘the\_good\_stuff’ (assuming you are using  
rjs).

Fred

---

<div class="post-metadata">

**Author:** ![dezrtdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dezrtdude](https://www.ruby-forum.com/u/dezrtdude)\
**Post date:** [June 18, 2008, 12:03am UTC](https://www.ruby-forum.com/t/javascript-or-otherwise-waiting-page/140724/3 "2008-06-18T00:03:24Z")

</div>

On Jun 17, 5:35 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> You could easily enough have a periodically\_call\_remote that would  
> poll some url. when the time is right have that page render  
> page.redirect\_to :action =\> ‘the\_good\_stuff’ (assuming you are using  
> rjs).

Could you use RJS to call a helper method? Also, I’m having the worst  
time with Rails and routing. I create custom routes but it is  
insistent on finding an Object with “said” ID. I know it’s breaking  
form, but I’d like to be able to have a “waiting” route that is part  
of a particular path, and have it render the “waiting.html.erb” page  
without complaint. I’d assume there is a way to do that, but I’ve  
been out of the Rails loop for a bit.
