# Progressive output on the views

**URL:** <https://www.ruby-forum.com/t/progressive-output-on-the-views/186565>\
**Category:** Rails\
**Created:** [April 8, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/progressive-output-on-the-views/186565 "2010-04-08T23:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rorra](https://www.ruby-forum.com/u/rorra)\
**Post date:** [April 8, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/progressive-output-on-the-views/186565/1 "2010-04-08T23:35:05Z")

</div>

There is one web page that because it request data from several web  
services, it delays between 20 and 200 seconds.

So my idea is to display the status of the data that is being fetched  
(or even the data as its being fetched) to the user, so he don’t have to  
wait like 200 seconds thinking that perhaps the page is not working.

But until now, I always render the web pages totally at the end of the  
action in the controller.

What I need now, is to be able to display the view on the beginning of  
the action, and then to be able to throw javascript code to refresh the  
content of the same page, and finally throw a javascript redirection at  
the end of the view.

Any idea of how to archive progressive output in rails?

Thank you

Rodrigo D.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![rorra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rorra](https://www.ruby-forum.com/u/rorra)\
**Post date:** [April 8, 2010, 11:56pm UTC](https://www.ruby-forum.com/t/progressive-output-on-the-views/186565/2 "2010-04-08T23:56:18Z")

</div>

On Apr 8, 10:35 pm, Rodrigo D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What I need now, is to be able to display the view on the beginning of  
> the action, and then to be able to throw javascript code to refresh the  
> content of the same page, and finally throw a javascript redirection at  
> the end of the view.
> 
> Any idea of how to archive progressive output in rails?

I don’t think rails can stream requests like that at all. You could  
however have some javascript on the page periodically talking to your  
server to see if the data is ready for them

Fred
