Created
October 22, 2012 08:51
-
-
Save sakuemon/3930440 to your computer and use it in GitHub Desktop.
rails3 エラー時に指定した画面を出す。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://ar156.dip.jp/tiempo/publish/52 | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
rescue_from Exception, :with => :error_500 | |
def error_500(exception) | |
logger.error "#{exception.message}" | |
render :file => "#{Rails.root}/public/500.html", :status => 500, :layout => false, :content_type => 'text/html' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment