I'm trying to use a Backbone.js model to keep track of what guides a user has seen. I would like to store the value in User.guides which is a serialized field in rails.
var Model = Backbone.Model.extend({
urlRoot : '/users',
defaults : {
user : {
guides : {
step1 : false,
step2 : false
}
}
}
});
That's what happens on load. Later on when I try to make an update:
me.model.set({
user : {
room_wizard : {
project_completed : true
}
}
});
me.model.save();
The problem here is Rails is erroring for the following reasons:
- Backbone.js is posting to create as JS when it should be Update as JSON? Why?
Ideas? Am I handling the above incorrectly? I'm new to backbone.js Thanks