Hi, I know how to change the status code in a response; render :status => 403, ... But how do i change the message that goes with it? Eg; the default message for 403 is "Forbidden", but I''d like to change it to something else. Thanks, Tyler --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 7, 2007, at 06:49, Tyler MacDonald wrote:> Hi, > > I know how to change the status code in a response; > > render :status => 403, ... > > But how do i change the message that goes with it? Eg; the default > message for 403 is "Forbidden", but I''d like to change it to something > else. > > Thanks, > TylerHi! AFAIK status message is a part of HTTP specification along with the code, thus I think you cannot change it easily. If you want to display some special message for an error code, you should probably make use of ErrorDocument Apache directive or the like. Yours sincerely, Damian/Three-eyed Fish --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Acutally, the status is just a header (Status: ...) so you can set it to anything you want. Doesn''t make it a good idea though... the messages are indeed part of the http spec... although most clients probably just look at the numeric code. b Damian Terentyev wrote:> On Mar 7, 2007, at 06:49, Tyler MacDonald wrote: > >> Hi, >> >> I know how to change the status code in a response; >> >> render :status => 403, ... >> >> But how do i change the message that goes with it? Eg; the default >> message for 403 is "Forbidden", but I''d like to change it to something >> else. >> >> Thanks, >> Tyler > > Hi! > AFAIK status message is a part of HTTP specification along with the > code, thus I think you cannot change it easily. > If you want to display some special message for an error code, you > should probably make use of ErrorDocument Apache directive or the like. > > Yours sincerely, > Damian/Three-eyed Fish > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---