Routes With Same URL Mapped To Different Actions

MaggotChild
Wed, 09 Sep 2009 23:06:05 -0000

Can''t find the answer to this. My old message received no responses
(subject was messed up).

Is it possible to create routes that have the same URL yet map to a
different action based on the HTTP method (or pseudo method) like a
Rails'' resource?

For example:

map.resources :foo, :collection => { :purge  => :get, :purge_them
=> :post }

I''d like to use /foo/purge for both actions, and have the appropriate
controller method called based on the HTTP request''s method -like /foo
does for the create and index methods, amongst others.