I have an application in rails 3 using backbone.js
When I use @model.save, i got an ajax call like this :
{"_id"=>"4fb8febe7d552d0a5e000010",
"email"=>"toto@test.com",
"invited_by_id"=>nil,
"invited_by_type"=>nil,
"role"=>"2",
"id"=>"4fb8febe7d552d0a5e000010"}
I don’t have my model name as key of my post parameters. I was expecting :
{ “user” =>
{"_id"=>"4fb8febe7d552d0a5e000010",
"email"=>"toto@test.com",
"invited_by_id"=>nil,
"invited_by_type"=>nil,
"role"=>"2",
"id"=>"4fb8febe7d552d0a5e000010"
}
}
How can i solve this problem?
Thank you
This is the role of url & urlRoot. Setting your model’s
urlRootto say/usersand configuring your server side routes accordingly does this job.