Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created July 6, 2012 15:32
Show Gist options
  • Save jonpaul/3060916 to your computer and use it in GitHub Desktop.
Save jonpaul/3060916 to your computer and use it in GitHub Desktop.
example
#SomeController
def show
with_404 { Model.find(params[:id]) }
end
#ApplicationController
def with_404
yield
rescue ActiveRecord::RecordNotFound
# handle error
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment