Created
December 11, 2008 02:50
-
-
Save evanwalsh/34588 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
# Put this in routes.rb at the very bottom (right before end) | |
map.error '*path', :controller => 'application', :action => 'rescue_404' | |
# Put this in application.rb | |
rescue_from ActiveRecord::RecordNotFound, ActionController::UnknownAction, :with => :rescue_404 | |
def rescue_404 | |
render :template => "errors/404", :layout => "application", :status => "404" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment