views:

80

answers:

1

I thought I read that when a Ruby on Rails server is running in production mode, it won't say so much about an error (the details, showing the code)... but I just try to run the server using

ruby script/server -e production

and add a <%= x %> with the local variable x undefined. It showed a lot of error details including the code... is there a way to make it look better?

A: 

It depends on what do you want to achieve - you might add general exception catching / rescue_from procedure to the ApplicationController, and there put error logging and redirect to some generic "we're sorry" page.

Peteris
I thought there is a general switch that let all error message be "We are experiencing problems -- the error has be logged. Please check back later." or even just a "500 Server Error" instead of showing code details.
動靜能量