Forum: Ruby on Rails how do i change the status message?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
52cb4115a870ff1942e7e1ae96f4306f?d=identicon&s=25 Tyler MacDonald (Guest)
on 2007-03-07 04:51
(Received via mailing list)

  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

2f24c382600d9fd71085a74251fd5a39?d=identicon&s=25 Damian Terentyev (Guest)
on 2007-03-08 16:56
(Received via mailing list)
On Mar 7, 2007, at 06:49, Tyler MacDonald wrote:

>   Thanks,
>     Tyler

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
8310c5a7c769345114597bcdef111488?d=identicon&s=25 Ben Munat (Guest)
on 2007-03-08 20:00
(Received via mailing list)
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 topic is locked and can not be replied to.