-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `delete' for true:TrueClass when executing destroy #89
Comments
What is the response sent back from the API? The only way you could get this error is if the response body would be json = MultiJson.load('true')
json.delete(:errors) # raises NoMethodError: undefined method `delete' for true:TrueClass I actually wanted to implement some kind of check for this over the weekend to make sure this error doesn’t happen because I thought that only objects or arrays could be sent back from Anyway, making the endpoint called by |
FWIW, I just pushed a commit in master (30584da) that should provide a better error message when encountering this problem. Will be part of the next release. |
You're right, the response is true Is there a best practice how such a response message should look like? |
By default, if the server returns an empty hash ( In my opinion, a good practice would be to return an empty response and send it using the |
I’m going to close this issue now. Please let me know if you have further questions! |
Sorry, but I haven't got time yet to test it. But the case is clear to me and I will change the response messages. Thanks for your work and help! |
This is what I get when I execute 'destroy' on a resource. The resource itself is deleted afterwards.
The text was updated successfully, but these errors were encountered: