I'm using Backbone to create a site where users would interact with content (bookmark, star, etc) and I want a way to store the content a user has interacted with in the user data. Simple enough, but I'm looking for info on the best approach here.
I have built the prototype without user accounts, so the content itself stores the interaction right now (in the metadata of that content), but to open this up to more than one user at a time, I want to change it so that once a user saves a piece of content, the ID of that content gets saved into their account data (the same place I have their username, etc)
I'm using the localStorage adapter now and I load the content in on page load, but the ID of the models changes each time. Once I move to a REST db with user accounts, I'm not sure how to save the piece of content the user has interacted with in their account details object and be able to reliably use that in the UI.
Any help pointing me in the right direction would be great.
Paul
Aucun commentaire:
Enregistrer un commentaire