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
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
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
return head (:method_not_allowed) sends an empty response with HTTP status 405.
But where is the translation of the symbol to the error code number?
Rack::Utils::HTTP_STATUS_CODES
(At least, that's what Rails is using at master. Not sure about 2.3.x)