Save only certain model attributes in Backbone.js
When calling model.save() in Backbone.js all model attributes will be persisted (sent to the server).
It may be done by passing a specific option argument to toJSON
method. It is done in save
method. You may create a base class and extend all your models from that base class. This way all extended classes that will have whitelistSaveAttributes
will whitelist attributes on saving: