Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Commit

Permalink
add not-found handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rococodogs committed Oct 9, 2017
1 parent f31aedb commit 51dcb21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
class ApplicationController < ActionController::API
rescue_from ActiveRecord::RecordNotFound, with: :not_found

private
def not_found(error)
render json: { error: error.message, status: 404 }, status: 404
end
end

0 comments on commit 51dcb21

Please sign in to comment.