# 501 and 405 slightly inaccurate?

**URL:** <https://www.ruby-forum.com/t/501-and-405-slightly-inaccurate/181437>\
**Category:** Rails\
**Created:** [January 12, 2010, 1:09am UTC](https://www.ruby-forum.com/t/501-and-405-slightly-inaccurate/181437 "2010-01-12T01:09:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJ\_ONeal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@AJ\_ONeal](https://www.ruby-forum.com/u/AJ_ONeal)\
**Post date:** [January 12, 2010, 1:09am UTC](https://www.ruby-forum.com/t/501-and-405-slightly-inaccurate/181437/1 "2010-01-12T01:09:15Z")

</div>

Since Rails routes know which methods are implemented per controller,  
why  
does “Allows” always contain these items?  
Allows =\> “POST, GET, PUT, DELETE”

Shouldn’t the list be built by polling a method? Something like:  
my\_controller.responds\_to? :put

I would think that 501 (server related) would be better for a method  
which  
will be implemented in the future and that 405 (access related) should  
signify that the option was considered and decided against.

AJ ONeal

---

<div class="post-metadata">

**Author:** ![AJ\_ONeal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@AJ\_ONeal](https://www.ruby-forum.com/u/AJ_ONeal)\
**Post date:** [January 12, 2010, 1:05pm UTC](https://www.ruby-forum.com/t/501-and-405-slightly-inaccurate/181437/2 "2010-01-12T13:05:41Z")

</div>

On Jan 12, 12:07Â am, AJ ONeal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Since Rails routes know which methods are implemented per controller, why  
> does “Allows” always contain these items?  
> Allows =\> “POST, GET, PUT, DELETE”
> 
> Shouldn’t the list be built by polling a method? Something like:  
> my\_controller.responds\_to? :put

If you are using restful routes then rails could probably work out  
from the routing info what methods are supporter for a given URI,  
although it doesn’t know in the more general case.

Fred
