Skip to content

Instantly share code, notes, and snippets.

@mikeblum
Created February 15, 2014 22:31
Show Gist options
  • Save mikeblum/9026096 to your computer and use it in GitHub Desktop.
Save mikeblum/9026096 to your computer and use it in GitHub Desktop.
Override backbone sync
sync: function (method, model, options) {
Backbone.sync.call(method, model, options);
}
//from http://stackoverflow.com/a/18839219/1377866
@mikeblum
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment