Optional route parameters for resource routes?

I have the following URL:


Where images is a resource setup via map.resources :images. I want to take advantage of caching, and caching ignores parameters. So I need to make size optional in the url:


Something like that where the size can be built into the URL. I looked through all of the map.resources documentation and couldn't find anything to do this. Any ideas how I can accomplish this?

Thanks for your help.

map.resources :images, :member => [:500, :1000]

will map to 2 methods in your controller, but I think you might have problems giving ruby method names that start with numbers.

you probably just have to make a specially entry in your routes file, something like this:

map.cached_image '/images/:id/:size', :controller => "images", :action => "show"

in your show method just check for the presence of :show in the params and respond appropriately.