# Where can I find the pre-defined constants for the "head" method? e.g. "return head(:method\_not\_al

**URL:** <https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351>\
**Category:** Rails\
**Created:** [February 12, 2010, 7:30am UTC](https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351 "2010-02-12T07:30:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [February 12, 2010, 7:30am UTC](https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351/1 "2010-02-12T07:30:14Z")

</div>

Hi,

Where can I find the pre-defined constants for the “head” method?

e.g. “return head(:method\_not\_allowed)” =\> implies  
“:method\_not\_allowed” must come from somewhere

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [February 12, 2010, 8:56am UTC](https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351/2 "2010-02-12T08:56:16Z")

</div>

They’re just the underscored names of HTTP statuses as symbols. You  
can find a list of http statuses here:  
[http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)

return head (:method\_not\_allowed) sends an empty response with HTTP  
status 405.

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [February 12, 2010, 9:53am UTC](https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351/3 "2010-02-12T09:53:01Z")

</div>

But where is the translation of the symbol to the error code number?

On Feb 12, 5:54 pm, Emery F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![greghauptmann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e5b9ba/32.png) [@greghauptmann](https://www.ruby-forum.com/u/greghauptmann)\
**Post date:** [February 12, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/where-can-i-find-the-pre-defined-constants-for-the-head-method-e-g-return-head-method-not-al/183351/4 "2010-02-12T13:39:31Z")

</div>

On Fri, Feb 12, 2010 at 03:51, greghauptmann [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > On Feb 12, 1:28 am, greghauptmann [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
> > –  
> > You received this message because you are subscribed to the Google G. “Ruby on Rails: Talk” group.  
> > To post to this group, send email to removed\_email\_address@domain.invalid.  
> > To unsubscribe from this group, send email to removed\_email\_address@domain.invalid.  
> > For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

Rack::Utils::HTTP\_STATUS\_CODES

(At least, that’s what Rails is using at master. Not sure about 2.3.x)
