-
Yes, you can have your resource appear in the resource map as many
times as you like. Just a word of warning, though. The more times
that it appears in the map, the more complex your controller can/will
become; you’ll have to be prepared to handle a request from ANY of
those paths. You may limit the footprint through your UI but that
could be circumvented by the person who’s watching your pretty URLs. -
Yes, you can pass multiple parameters. For an oversimplified
example, think about the update path. You’ve probably got at least as
many parameters as columns getting posted with each update request.
In your case you might have several UI’s related to them that make
them appear to be a “Complete the milestone” and a “Create the
milestone” or a “Fix an error in the milestone” path, but they’re all
fundamentally updates coming with potentially different set of
“filters”.
The key point with REST is that you have a resource at a known address
that responds in a known way, setting or getting state, each time to
call it on that address. In this case, you milestones#index is going
to respond with a list of milestones every single time. In some cases
it’s the complete list (not nested), in some cases it’s a list bound
by a user, and in other cases it’s further filtered (or sorted…)
based on the parameters you send up. The big deal, though is that
it’s always reporting back on the state of the collection.
- Obie’s is the best overall source I’ve read so far. I have not yet
seen the Agile 3ed that’s out in Beta but I’d bet it has a fair
covering of it, too. Rails Advanced Recipes is a good resource but
it’s not specifically devoted to REST.