Last active
August 29, 2015 14:03
-
-
Save giiska/b6d03c2b9ede78105c97 to your computer and use it in GitHub Desktop.
Set `options.attrs` will allow you customise api param
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
// when model.attributes is different from the params to save | |
// e.g. when save to restful api, one attr should be `resource_uri` | |
// formated as string type, but the returned attr value in json is object formated | |
var model = new Backbone.Model(); | |
model.save(null, { | |
wait: true, | |
success: function() { | |
}, | |
attrs: _.omit(model.attributes, 'selected') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment