Created
February 2, 2015 12:17
-
-
Save adamdilek/a1b4e1e691508bc30088 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rescue_from Exception, :with => :server_error | |
def server_error(exception) | |
respond_to do |format| | |
format.html { render template: 'errors/internal_server_error', layout: 'layouts/application', status: 500 } | |
format.all { render nothing: true, status: 500} | |
end | |
end | |
rescue_from ActiveRecord::RecordNotFound, :with => :page_not_found | |
rescue_from ActionController::RoutingError, :with => :page_not_found | |
def page_not_found | |
respond_to do |format| | |
format.html { render template: 'errors/not_found', layout: 'layouts/application', status: 404 } | |
format.all { render nothing: true, status: 404 } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment