How do i change the status message?


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


On Mar 7, 2007, at 06:49, Tyler MacDonald wrote:


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

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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs