Created
May 5, 2009 18:45
-
-
Save tmilewski/107123 to your computer and use it in GitHub Desktop.
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
class ApplicationController < ActionController::Base | |
protected | |
def rescue_optional_error_file(status_code) | |
known_codes = ["404", "422", "500"] | |
status = interpret_status(status_code) | |
if known_codes.include?(status_code) | |
render :template => "/errors/#{status[0,3]}.html.erb", :status => status, :layout => 'application.html.erb' | |
else | |
render :template => "/errors/unknown.html.erb", :status => status, :layout => 'application.html.erb' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment