title: Singular resources namespaced by its slug (Routing)
body: <p>I have the followed Rails 3 routes:</p>
  
  <pre><code>Hello::Application.routes.draw do
    resources :blogs do
      resources :articles do
        resources :comments
      end
    end
  end
  </code></pre>
  
  <p>By raking them, we can find:</p>
  
  <pre><code>                          GET    /blogs/:blog_id/articles/:article_id/comments(.:format)          {:action=&gt;"index", :controller=&gt;"comments"}
      blog_article_comments POST   /blogs/:blog_id/articles/:article_id/comments(.:format)          {:action=&gt;"create", :controller=&gt;"comments"}
   new_blog_article_comment GET    /blogs/:blog_id/articles/:article_id/comments/new(.:format)      {:action=&gt;"new", :controller=&gt;"comments"}
                            GET    /blogs/:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"show", :controller=&gt;"comments"}
                            PUT    /blogs/:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"update", :controller=&gt;"comments"}
       blog_article_comment DELETE /blogs/:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"destroy", :controller=&gt;"comments"}
  edit_blog_article_comment GET    /blogs/:blog_id/articles/:article_id/comments/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"comments"}
                            GET    /blogs/:blog_id/articles(.:format)                               {:action=&gt;"index", :controller=&gt;"articles"}
              blog_articles POST   /blogs/:blog_id/articles(.:format)                               {:action=&gt;"create", :controller=&gt;"articles"}
           new_blog_article GET    /blogs/:blog_id/articles/new(.:format)                           {:action=&gt;"new", :controller=&gt;"articles"}
                            GET    /blogs/:blog_id/articles/:id(.:format)                           {:action=&gt;"show", :controller=&gt;"articles"}
                            PUT    /blogs/:blog_id/articles/:id(.:format)                           {:action=&gt;"update", :controller=&gt;"articles"}
               blog_article DELETE /blogs/:blog_id/articles/:id(.:format)                           {:action=&gt;"destroy", :controller=&gt;"articles"}
          edit_blog_article GET    /blogs/:blog_id/articles/:id/edit(.:format)                      {:action=&gt;"edit", :controller=&gt;"articles"}
                            GET    /blogs(.:format)                                                 {:action=&gt;"index", :controller=&gt;"blogs"}
                      blogs POST   /blogs(.:format)                                                 {:action=&gt;"create", :controller=&gt;"blogs"}
                   new_blog GET    /blogs/new(.:format)                                             {:action=&gt;"new", :controller=&gt;"blogs"}
                            GET    /blogs/:id(.:format)                                             {:action=&gt;"show", :controller=&gt;"blogs"}
                            PUT    /blogs/:id(.:format)                                             {:action=&gt;"update", :controller=&gt;"blogs"}
                       blog DELETE /blogs/:id(.:format)                                             {:action=&gt;"destroy", :controller=&gt;"blogs"}
                  edit_blog GET    /blogs/:id/edit(.:format)                                        {:action=&gt;"edit", :controller=&gt;"blogs"}
  </code></pre>
  
  <p>Because every routes begin with the same root path (<em>/blogs</em>), I would like to shorten addresses by removing it (when :blog_id is given).</p>
  
  <p>In this why, I could have thoses routes (I think it's more DRY):</p>
  
  <pre><code>                          GET    /:blog_id/articles/:article_id/comments(.:format)          {:action=&gt;"index", :controller=&gt;"comments"}
      blog_article_comments POST   /:blog_id/articles/:article_id/comments(.:format)          {:action=&gt;"create", :controller=&gt;"comments"}
   new_blog_article_comment GET    /:blog_id/articles/:article_id/comments/new(.:format)      {:action=&gt;"new", :controller=&gt;"comments"}
                            GET    /:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"show", :controller=&gt;"comments"}
                            PUT    /:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"update", :controller=&gt;"comments"}
       blog_article_comment DELETE /:blog_id/articles/:article_id/comments/:id(.:format)      {:action=&gt;"destroy", :controller=&gt;"comments"}
  edit_blog_article_comment GET    /:blog_id/articles/:article_id/comments/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"comments"}
                            GET    /:blog_id/articles(.:format)                               {:action=&gt;"index", :controller=&gt;"articles"}
              blog_articles POST   /:blog_id/articles(.:format)                               {:action=&gt;"create", :controller=&gt;"articles"}
           new_blog_article GET    /:blog_id/articles/new(.:format)                           {:action=&gt;"new", :controller=&gt;"articles"}
                            GET    /:blog_id/articles/:id(.:format)                           {:action=&gt;"show", :controller=&gt;"articles"}
                            PUT    /:blog_id/articles/:id(.:format)                           {:action=&gt;"update", :controller=&gt;"articles"}
               blog_article DELETE /:blog_id/articles/:id(.:format)                           {:action=&gt;"destroy", :controller=&gt;"articles"}
          edit_blog_article GET    /:blog_id/articles/:id/edit(.:format)                      {:action=&gt;"edit", :controller=&gt;"articles"}
                            GET    /blogs(.:format)                                                 {:action=&gt;"index", :controller=&gt;"blogs"}
                      blogs POST   /blogs(.:format)                                                 {:action=&gt;"create", :controller=&gt;"blogs"}
                   new_blog GET    /blogs/new(.:format)                                             {:action=&gt;"new", :controller=&gt;"blogs"}
                            GET    /blogs/:id(.:format)                                             {:action=&gt;"show", :controller=&gt;"blogs"}
                            PUT    /blogs/:id(.:format)                                             {:action=&gt;"update", :controller=&gt;"blogs"}
                       blog DELETE /blogs/:id(.:format)                                             {:action=&gt;"destroy", :controller=&gt;"blogs"}
                  edit_blog GET    /blogs/:id/edit(.:format)                                        {:action=&gt;"edit", :controller=&gt;"blogs"}
  </code></pre>
  
  <p>According to you, what kind of change I should make over my current routes configuration?</p>
  
  <p>Thanks.</p>