Restful routes in edge and multiple paths to a resource

We're rolling our own blog ( if you want an explanation as to why on earth we'd do this), and I'm using a couple of nice restful routes in the obvious way:

  map.resources :articles do |articles|     articles.resources :comments   end

Makes sense, but I'd also like to be able to have an independent route:

  map.resources :comments

so that I can have an admin view of all the recent comments. This obviously doesn't work because all the named routes clash, and I imagine I need a separate controller to handle it too, given the logic is a bit different.

Is there a way to make this work which is neat and relatively painless, or should I just build a non-restful controller to handle it?


Pete Yandell

P.S. I tried posting this message to the list via email a couple of days ago, but it hasn't appeared. My apologies if it suddenly shows up and becomes a duplicate.

You can define the duplicate comment routes with the :name_prefix option.