Forum: Ruby on Rails A RESTful way for filtering results?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
801d77fa9f3ebc9c3ca83b1bf2052ac7?d=identicon&s=25 Mike Rumble (Guest)
on 2007-06-25 21:50
(Received via mailing list)

Recently I've been getting stuck in with ActiveResource and all the
wonderful things that REST has to offer.

There are a couple of things that I've been throwing around in my head
which I can't quite settle on so I was hoping that some of the more
experienced Rails programmers on here might be able to help me.

I have an articles controller on to which I wish to add some filtering
for the index action. Traditionally you'd have something like /
articles/index?user_id=1, but I'm struggling to work out the best
approach to making this REST friendly. It's straight forward enough to
do it the other way around using nested resources for user, ending up
with something like users/1/articles, but I'm looking to do it the
other way around so I'd end up with something like articles/user/1 but
this doesn't map well on to ActiveResource and isn't very scalable,
for example I would like to be able to add compound filters, ie, /

Am I best of just sticking to the good old query string and breaking
out of the REST paradigm in this instance? Anybody have any experience
of creating an app which uses a RESTful approach to filtering like
This topic is locked and can not be replied to.