# Status bar - while controller action is time intensive

**URL:** <https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794>\
**Category:** Rails\
**Created:** [April 15, 2008, 7:15am UTC](https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794 "2008-04-15T07:15:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [April 15, 2008, 7:15am UTC](https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794/1 "2008-04-15T07:15:57Z")

</div>

Hi,

I have a time consuming action in a controller. So when a user clicks  
on this link to this time consuming action, I would like give users a  
status bar, saying something like “LOADING…”. How do i do that?

1. I have used remote\_function stuff to show hidden status-indicator in  
other parts of the application.

Whats the best given my case?

Regards,  
Sandeep G

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [April 15, 2008, 7:23am UTC](https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794/2 "2008-04-15T07:23:29Z")

</div>

In the layout file on body tag use onload and unload functions to show  
the  
status bar.

On Tue, Apr 15, 2008 at 10:45 AM, Sandeep G. \<

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [April 15, 2008, 8:03am UTC](https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794/3 "2008-04-15T08:03:34Z")

</div>

Thanks Kishore. But isn’t body onload and unload functions called before  
rendering and after rendering?

Or is it before starting the controller action and after controller  
action?  
If so, wouldn’t this clash with window.load , window.unload functions in  
JS.

I already have window.load , window.unload functions in my JS. Would  
this clash?

Regards,  
Sandeep G

Bala kishore Pulicherla wrote:

> In the layout file on body tag use onload and unload functions to show  
> the  
> status bar.
> 
> On Tue, Apr 15, 2008 at 10:45 AM, Sandeep G. \<

---

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [April 15, 2008, 8:57am UTC](https://www.ruby-forum.com/t/status-bar-while-controller-action-is-time-intensive/134794/4 "2008-04-15T08:57:51Z")

</div>

On Apr 15, 7:03 am, Sandeep G. \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> Thanks Kishore. But isn’t body onload and unload functions called before  
> rendering and after rendering?

Those won’t help. The page is only sent to the browser when rails has  
completely finished with it (ie after all of your time consuming  
controller code has run)

Fred
