# How to filter info and keep everything DRY

**URL:** <https://www.ruby-forum.com/t/how-to-filter-info-and-keep-everything-dry/149249>\
**Category:** Rails\
**Created:** [September 22, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/how-to-filter-info-and-keep-everything-dry/149249 "2008-09-22T22:29:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![max](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@max](https://www.ruby-forum.com/u/max)\
**Post date:** [September 22, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/how-to-filter-info-and-keep-everything-dry/149249/1 "2008-09-22T22:29:10Z")

</div>

Hey, I’m trying to give this problem the best solution possible:

I have a posts and an events model  
both have categories, tags and belong both to users and groups

Now I need to filter results by any of the above, let it be category,  
tag, user or group. What is the best way to do this?

I’m thinking of passing a variable in params[:whatever] and then have  
a case in the controller and rendering the apropiate view. But it  
doesnt feel right or very REST-y

Can anyone help with this? thanx.

---

<div class="post-metadata">

**Author:** ![max](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@max](https://www.ruby-forum.com/u/max)\
**Post date:** [September 23, 2008, 5:53am UTC](https://www.ruby-forum.com/t/how-to-filter-info-and-keep-everything-dry/149249/2 "2008-09-23T05:53:59Z")

</div>

I am facing a similar problem. Does anyone knows how to make this REST-  
y?
