Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Created October 11, 2008 20:43
Show Gist options
  • Save technicalpickles/16321 to your computer and use it in GitHub Desktop.
Save technicalpickles/16321 to your computer and use it in GitHub Desktop.
%p Whoops! The resource you were looking for wasn't found.
class ApplicationController < ActionController::Base
def render_404
render :template => "errors/404", :status => "404"
end
def rescue_action_in_public(exception)
case exception
when ActiveRecord::RecordNotFound
when ActiveRecord::RecordInvalid
when ActionController::RoutingError
when ActionController::UnknownController
when ActionController::UnknownAction
when ActionController::MethodNotAllowed
render_404
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment