This post originated from an RSS feed registered with Ruby Buzz
by rwdaigle.
Original Post: What's New in Edge Rails: Shallow Routes
Feed Title: Ryan's Scraps
Feed URL: http://feeds.feedburner.com/RyansScraps
Feed Description: Ryan Daigle's various technically inclined rants along w/ the "What's new in Edge Rails" series.
Rails’ routing mechanism is pretty slick. In a very intuitive way you’re able to describe the resources you want exposed at the URL level with this routing-DSL:
However, while this configuration makes articles available at /users/1/articles and comments at /users/1/articles/1/comments there are often times when you want to bypass the full nested hierarchy and directly access the resource in question. Now, with the shallow route option, you can.