Reposting, since I think this may be close to what you're looking for:
def index
args = {}
[:user_id, :group_id, :category_id, :tag_id].each do |k|
args[k] = params[k] if params[k]
end
@posts = Post.find(:all, :conditions => args)
end
Which will filter for the following, assuming you've setup your routes
correctly:
/users/1/posts
/groups/1/posts
/categories/1/posts
/tags/1/posts
/users/1/categories/1/posts
/users/1/tags/1/posts
/groups/1/categories/1/posts
/groups/1/tags/1/posts
...
/groups/1/users/1/categories/1/tags/1/posts (although I doubt you'll
be having this kind of route)
In short, it will accept filters for a route with a combination of
users, groups, categories, and tags.
HTH