benpickles / js-model

Work with models in your JavaScript
http://benpickles.github.io/js-model/
MIT License
403 stars 42 forks source link

POST - REST persistence #42

Open Robomedia opened 8 years ago

Robomedia commented 8 years ago

var Project = new Model('project', function(){ this.persistence(Model.REST, "api/projects"); }); var project = new Project({name:"testing12345"}); project.save();

It will send data like this : {project: {name: "testing12345"} } yet my backend expect just attributes {name:"testing12345"} . Can this be configured in js-model, or do I have to change my API ?

thx