# Queue 3 or more RJS actions

**URL:** <https://www.ruby-forum.com/t/queue-3-or-more-rjs-actions/64209>\
**Category:** Rails\
**Created:** [June 23, 2006, 2:54am UTC](https://www.ruby-forum.com/t/queue-3-or-more-rjs-actions/64209 "2006-06-23T02:54:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [June 23, 2006, 2:54am UTC](https://www.ruby-forum.com/t/queue-3-or-more-rjs-actions/64209/1 "2006-06-23T02:54:46Z")

</div>

My .rjs file  
page.visual\_effect :BlindUp, “people”, :queue =\> ‘front’ #first  
action  
page.replace\_html “people”, :partial =\> ‘person/person\_compressed’,  
:collection =\> @search\_results , :queue =\> ‘end’ #second action, after  
first is done  
page.visual\_effect :BlindDown, “people” , :queue =\> ‘end’ #third  
action, after second is done

I want it to BlindUp, replace the div, and then BlindDown the div with  
its new content. Instead it BlindsUp first and then BlindsDown/replaces  
the div pretty much at the same time. I need three things to happen in  
order and ‘front’ and ‘end’ only let me set the order for two things.

My reference so far has been  
[http://blog.railsdevelopment.com/pages/effect/queue/](http://blog.railsdevelopment.com/pages/effect/queue/)  
It talks about using :scope with :queue. I tried changing all the  
:queue in the above example to :queue =\> {:scope=\> ‘myscope’}  
hoping that this would set up my queue but that did not appear to work.

Any help is greatly appreciated.

Matthew M.  
[blog.mattmargolis.net](http://blog.mattmargolis.net)

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [June 23, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/queue-3-or-more-rjs-actions/64209/2 "2006-06-23T13:50:33Z")

</div>

Matthew,

You can pass the replace html to beforeStart (of blinddown), this will  
perform the visual effect before the effect is executed.

–  
Abdur-Rahman A.  
[http://blog.railsdevelopment.com/](http://blog.railsdevelopment.com/)

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [June 23, 2006, 3:41pm UTC](https://www.ruby-forum.com/t/queue-3-or-more-rjs-actions/64209/3 "2006-06-23T15:41:44Z")

</div>

Abdur-Rahman A. wrote:

> Matthew,
> 
> You can pass the replace html to beforeStart (of blinddown), this will  
> perform the visual effect before the effect is executed.

What is the syntax I would use for beforeStart?  
If I do

page.visual\_effect :BlindDown, “people” , :queue =\> ‘end’, {:beforeStart  
=\> page.replace\_html “people”, :partial=\>‘mypartial’}

then I get parse errors on the rjs file.  
[http://rails.techno-weenie.net/question/2006/5/3/how\_to\_use\_ajax\_callbacks\_in\_rjs\_templates](http://rails.techno-weenie.net/question/2006/5/3/how_to_use_ajax_callbacks_in_rjs_templates)  
shows using Javascript in beforeStart. Can I use the rjs methods like  
replace\_html too?

Thank you,  
Matthew M.  
[blog.mattmargolis.net](http://blog.mattmargolis.net)
