# Custom Routes: Determining Action Named Based On Method

**URL:** <https://www.ruby-forum.com/t/custom-routes-determining-action-named-based-on-method/175151>\
**Category:** Rails\
**Created:** [September 9, 2009, 1:01am UTC](https://www.ruby-forum.com/t/custom-routes-determining-action-named-based-on-method/175151 "2009-09-09T01:01:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaggotChild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Post date:** [September 9, 2009, 1:01am UTC](https://www.ruby-forum.com/t/custom-routes-determining-action-named-based-on-method/175151/1 "2009-09-09T01:01:23Z")

</div>

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)?

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 create and index, amongst others.
