REST route with multiple ids

How can I configure a REST route to accept multiple ids?

for instance, in Highrise by 37signals tags have either routes like

I suppose it's done with some regexp expertize, but I have none, and I
wouldn't know where to put it. A hand would be appreciated.

In the instance of those comma-separated multiple tags, params[:id] is
"47824,43622,43628" and it's just being split or handled in the
method. I don't think :id gets coerced to an integer because that
could spoil implementations of routing which use to_param differently.
[I could totally be off on that.] But I'm pretty sure that
"47824,43622,43628" is just a string getting split on the commas
something like

Tag.find params[:id].split(",")

I'd love to find out if I'm wrong and what the real implementation is.
I'm kinda curious now.


Russell, you are right. I just tried this using a Page model. You
could also send up a list of the tag names instead of the id's, making
it a little more semantic (see Jonathan Linowes on

but how do I set a route for that? Right now I get this error:

no route found to match "/tags/19,16" with {:method=>:get}

I'm on rails 1.2.4. Are you on 2.0, or am I missing something else?

Add this to your environment.rb
ActionController::Routing::SEPARATORS = %w(/ ; . ?)

OK, that works, thanks Pablo.

So if I by adding this line I'm actually removing ',' from the
SEPARATORS array... You've introduced me to SEPARATORS, and made me
understand I could use any characters except the ones in that array.
So instead of adding that line and using ',' II decided to simply use
'+', à la There's no drawbacks in using '+' is there? For


It works, but "+" is a space URL encoded (RFC1738). That's mean in
your controller you should split by spaces instead of '+'.