Skip to content

Instantly share code, notes, and snippets.

@tmilewski
Created May 5, 2009 18:45
Show Gist options
  • Save tmilewski/107123 to your computer and use it in GitHub Desktop.
Save tmilewski/107123 to your computer and use it in GitHub Desktop.
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