Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created December 15, 2011 15:31
Show Gist options
  • Save wrburgess/1481498 to your computer and use it in GitHub Desktop.
Save wrburgess/1481498 to your computer and use it in GitHub Desktop.
Error handling in Rails
begin
variable = Model.where("column >= ?", value)
rescue ActiveRecord::RecordNotFound
redirect_to "/404.html"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment