Skip to content

Instantly share code, notes, and snippets.

@giiska
Last active August 29, 2015 14:03
Show Gist options
  • Save giiska/b6d03c2b9ede78105c97 to your computer and use it in GitHub Desktop.
Save giiska/b6d03c2b9ede78105c97 to your computer and use it in GitHub Desktop.
Set `options.attrs` will allow you customise api param
// 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