Skip to content

Instantly share code, notes, and snippets.

@sakuemon
Created October 22, 2012 08:51
Show Gist options
  • Save sakuemon/3930440 to your computer and use it in GitHub Desktop.
Save sakuemon/3930440 to your computer and use it in GitHub Desktop.
rails3 エラー時に指定した画面を出す。
# 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