javascript - Backbone.js: Best way to save a changed model id to the server -
i want allow user change id
of model in collection.
then have problem when call model.save()
model saved wrong location. put
url of new id instead url of old id
var model = collection.get('oldid'); model.set({id: 'newid'}); // set user through ui model.save();
this save collectionurl/ + 'newid'
instead of collectionurl/ + 'oldid'
i want save (put) {id: 'newid'} old url.
what consistent way of doing this?
this edge case there's no best practices it.
i try overwriting backbone.sync and/or backbone.model save make backbone behave way. did similar thing when using backbone in air app when saving straight local database.
--edit
or maybe backbone.model url.
Comments
Post a Comment