# Load before show

**URL:** <https://www.ruby-forum.com/t/load-before-show/184441>\
**Category:** Rails\
**Created:** [March 2, 2010, 5:04pm UTC](https://www.ruby-forum.com/t/load-before-show/184441 "2010-03-02T17:04:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [March 2, 2010, 5:04pm UTC](https://www.ruby-forum.com/t/load-before-show/184441/1 "2010-03-02T17:04:25Z")

</div>

Hi everyone.

I have one problem and I donÂ´t know how to start to solve.Here it is:  
I want to do a webpage for show an image, that image change every  
second. I had succes for show and refresh the image every second, but  
the result that I obtain was not the best. this is due to the loading  
times. I think one solution but I donÂ´t know how to do it in rails. My  
solution is to show the old image while the new image is loading, and  
when it finishes the load show the new image. But the principal problem  
is that the new image itÂ´s saved on the file where it was the old image.  
Anyone can give any tip, about how can I do for solve this problem??

Thanks a lot!!

Erwillie

---

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [March 3, 2010, 11:13am UTC](https://www.ruby-forum.com/t/load-before-show/184441/2 "2010-03-03T11:13:34Z")

</div>

Ajax could work well here. Check out “periodically\_call\_remote”.

---

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [March 4, 2010, 2:08pm UTC](https://www.ruby-forum.com/t/load-before-show/184441/3 "2010-03-04T14:08:18Z")

</div>

Sharagoz – wrote:

> Ajax could work well here. Check out “periodically\_call\_remote”.

I use the periodically call remote for refresh the image, but now the  
thing I want is to show the old image before the new image is loading,  
because if I donÂ´t do that the image sequency doesnÂ´t seem a video. My  
question is How to hide the new image while it loads.

Thanks
