Created
July 25, 2013 14:57
-
-
Save ascot21/6080538 to your computer and use it in GitHub Desktop.
Return 404 if record not found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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