greghauptmann
2010-Feb-12 06:28 UTC
where can I find the pre-defined constants for the "head" method? e.g. "return head(:method_not_allowed)"
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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Emery Finkelstein
2010-Feb-12 07:54 UTC
Re: where can I find the pre-defined constants for the "head" method? e.g. "return head(:method_not_allowed)"
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. On Feb 12, 1:28 am, greghauptmann <greg.hauptm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
greghauptmann
2010-Feb-12 08:51 UTC
Re: where can I find the pre-defined constants for the "head" method? e.g. "return head(:method_not_allowed)"
But where is the translation of the symbol to the error code number? On Feb 12, 5:54 pm, Emery Finkelstein <emery.finkelst...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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. > > On Feb 12, 1:28 am, greghauptmann <greg.hauptm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > 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-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mat Brown
2010-Feb-12 12:38 UTC
Re: Re: where can I find the pre-defined constants for the "head" method? e.g. "return head(:method_not_allowed)"
On Fri, Feb 12, 2010 at 03:51, greghauptmann <greg.hauptmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> But where is the translation of the symbol to the error code number? > > On Feb 12, 5:54 pm, Emery Finkelstein <emery.finkelst...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> 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. >> >> On Feb 12, 1:28 am, greghauptmann <greg.hauptm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> >> > 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 > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at 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) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.