only update certain model attributes using Backbone.js
Posted
by
Drew Dara-Abrams
on Stack Overflow
See other posts from Stack Overflow
or by Drew Dara-Abrams
Published on 2011-03-15T00:06:41Z
Indexed on
2011/03/15
0:10 UTC
Read the original article
Hit count: 415
JavaScript
|backbone.js
With Backbone, I'm trying to update and save to the server just one attribute:
currentUser.save({hide_explorer_tutorial: 'true'});
but I don't want to send all the other attributes. Some of them are actually the output of methods on the server-side and so they are not actually true attributes with setter functions.
Currently I'm using unset(attribute_name) to remove all the attributes that I don't want to update on the server. Problem is those attributes are then no longer available for local use.
Suggestions on how to only save certain attributes to the server?
© Stack Overflow or respective owner