# Prepend\_before\_filter

**URL:** <https://www.ruby-forum.com/t/prepend-before-filter/85499>\
**Category:** Rails\
**Created:** [February 14, 2007, 1:52am UTC](https://www.ruby-forum.com/t/prepend-before-filter/85499 "2007-02-14T01:52:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 14, 2007, 1:52am UTC](https://www.ruby-forum.com/t/prepend-before-filter/85499/1 "2007-02-14T01:52:18Z")

</div>

I’ve got a couple of before\_filters that need to run in a specific  
order. One does a redirect\_to if a session variable isn’t set. The  
other does a find which will fail if the session variable isn’t set. So  
they need to run in that order. But prepend\_before\_filter doesn’t seem  
to be working as advertised. Anybody got any insight? I’m still  
running on 1.1.6

TIA,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 14, 2007, 1:55am UTC](https://www.ruby-forum.com/t/prepend-before-filter/85499/2 "2007-02-14T01:55:18Z")

</div>

On 2/13/07, Bill W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve got a couple of before\_filters that need to run in a specific  
> order. One does a redirect\_to if a session variable isn’t set. The other  
> does a find which will fail if the session variable isn’t set. So they need  
> to run in that order. But prepend\_before\_filter doesn’t seem to be working  
> as advertised. Anybody got any insight? I’m still running on 1.1.6
> 
> TIA,  
> Bill

I’ve never used prepend\_before\_filter, so I don’t have a clue. I have a  
similar scenario and I just have one before\_filter method that calls  
other  
methods in the order I need.

–  
Andrew S.

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [February 14, 2007, 3:25am UTC](https://www.ruby-forum.com/t/prepend-before-filter/85499/3 "2007-02-14T03:25:23Z")

</div>

Hi Andrew,

Andrew S. wrote:

> I just have one before\_filter method that  
> calls other methods in the order I need.

Thanks for your reply. I started going in that direction but, depending  
on  
the controlller, I call one, the other, or both in order so the  
before\_filter was getting kind of big and ugly.

May end up just having to live with that I guess.

Best regards,  
Bill
