Skip to content

Instantly share code, notes, and snippets.

@ascot21
Created July 25, 2013 14:57
Show Gist options
  • Select an option

  • Save ascot21/6080538 to your computer and use it in GitHub Desktop.

Select an option

Save ascot21/6080538 to your computer and use it in GitHub Desktop.
Return 404 if record not found
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
def record_not_found(exception)
render :json => {:errors => [exception.message]}, :status => 404
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment