On May 29, 11:50 am, Douglas S. <rails-mailing-l…@andreas-
Jeff Emminger wrote:
That would work, using nested resources. Have decided I was being
stupid, and have re-implemented my map.connect.
If it’s not too late, let me throw in my two cents
REST != map.resources
This is a common perception, because DHH’s posts about REST usually
included instructions about map.resources, a feature new to Rails 1.2
that made routing easier in some cases.
But you can have a 100% RESTful application just by using map.connect,
too. After all, map.resources is just shorthand for a bunch of named
routes (and named routes are just map.connect statements).
The url part after blog/ identifies your resource, right? So you can
map.connect /blog/:year:/:month/:day, :controller => :blog, :action
Then your BlogController has:
month = params[:month]
year = params[:year]
day = params[:day]
@entries = # get entries here
I’m simplifying, but hopefully you get the idea. You can have a
RESTful architecture whether you use map.connect or map.resources.