Rails: errors in production vs development
In Rails, is there a way to display different error messages on a production rails server (a nice graphic) vs a development serve开发者_如何转开发r (detailed error information, stack trace, etc.)?
Found one solution. In ApplicationController, add:
rescue_from Exception, :with => :rescue_all_exceptions if RAILS_ENV == 'production'
def rescue_all_exceptions(exception)
case exception
# do production-ey exception stuff
end
end
I'd be interested to hear other options...
精彩评论