Created
February 15, 2014 22:31
-
-
Save mikeblum/9026096 to your computer and use it in GitHub Desktop.
Override backbone sync
This file contains 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
sync: function (method, model, options) { | |
Backbone.sync.call(method, model, options); | |
} | |
//from http://stackoverflow.com/a/18839219/1377866 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to fire either options.success or options.error depending on whether the method succeeded. The methods are in the format:
"create" : expected that you create the model on the server
"read" : expected that you read this model from the server and return it
"update" : expected that you update the model on the server with the argument
"delete" : expected that you delete the model from the server.