Forum: Ruby on Rails 500 Error Page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hunter's Lists (Guest)
on 2005-12-16 03:41
(Received via mailing list)
I have an error page defined in my .htaccess file and I'm in production
mode.

Sometimes I still get the Application Error (Rails) white page though.
In
this case there was a nil object that I tried to access in a controller
without first checking if it was nil.

How does Rails decide what error page to display and how can I get the
pretty error page to display more often?

Thanks.
Ezra Z. (Guest)
on 2005-12-16 05:18
(Received via mailing list)
On Dec 15, 2005, at 5:40 PM, Hunter's Lists wrote:

> How does Rails decide what error page to display and how can I get the
> pretty error page to display more often?
>
> Thanks.


Hunter-

	I think what you are looking for is called rescue_action_in_public.
You can use it like this:

In application.rb

def rescue_action_in_public(exception)
   # Do something with exception. Either throw
   # a 404 or send am email to your self in here.
   render :text => "My pretty 404 page. exception : #{exception }"
end


And here's a link to more:  http://wiki.rubyonrails.com/rails/pages/
HowtoConfigureTheErrorPageForYourRailsApp


Cheers-

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
This topic is locked and can not be replied to.