# RESTFUL routes strange behavior

**URL:** <https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564>\
**Category:** Rails\
**Created:** [July 5, 2009, 4:48pm UTC](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564 "2009-07-05T16:48:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waheedi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9e5f3/32.png) [@waheedi](https://www.ruby-forum.com/u/waheedi)\
**Post date:** [July 5, 2009, 4:48pm UTC](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564/1 "2009-07-05T16:48:57Z")

</div>

routes.rb

api.resources :friends, :controller =\> :friends, :only =\>  
[:list, :exists], :collection =\> {:list =\> :get, :ids =\> :get, :exists  
=\> :get}

here is my rake routes.

list\_api\_friends GET /api/friends/list  
{:controller=\>“api/friends”, :action=\>“list”}

formatted\_list\_api\_friends GET /api/friends/  
list.:format {:controller=\>“api/  
friends”, :action=\>“list”}

this is the only accepted calls for controller =\> friends action =\>  
list , so when calling

curl -X POST [http://localhost/api/friends/list.xml](http://localhost/api/friends/list.xml) should return  
routing error but instead of that it returns the list as if was a GET  
request…

any suggestions

---

<div class="post-metadata">

**Author:** ![waheedi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9e5f3/32.png) [@waheedi](https://www.ruby-forum.com/u/waheedi)\
**Post date:** [July 5, 2009, 4:55pm UTC](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564/2 "2009-07-05T16:55:59Z")

</div>

On Jul 5, 8:33 am, Waheedi [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

Do you still have the default route at the bottom of routes.rb ?

Fred

---

<div class="post-metadata">

**Author:** ![waheedi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9e5f3/32.png) [@waheedi](https://www.ruby-forum.com/u/waheedi)\
**Post date:** [July 6, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/restful-routes-strange-behavior/171564/3 "2009-07-06T13:17:01Z")

</div>

definitely not its the lowest priority…

On Jul 5, 5:55 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
