jvoorhis | What’s New in Edge Rails: Restful Routes
Restful Routes talks about the new RESTful programming models that are now possible in Rails (now in Edge, soon to be in the released version). In this case, the url /comments/1;approve would be created. The rationale is to use the path to the left of the semicolon for a resource’s identity, and to use the path to the right of the semicolon as a modifier. Frequently this modifier would be an operation that you would perform on the resource, such as approving a comment that requires moderation. This isn't very restful. This modifier hack is just another way to force another verb into the mix. The best way to be more RESTful would be to PUT a representation of the comment with the approval flag set to true. In REST, representations of resources are exchanged. Instead of referencing the URI of the comment, with a verb modifier stuck on the end, send along a representation of the whole comment. Now, you're saying, "But how do I do that in Rails?" This is, of course,