emberjs/data — pull request #257 by twalpole (2012-05-16 18:57:53+00:00)
Title: Support for nested REST resources (and tests)

This adds support (and tests) for accessing models via nested REST resources. The nesting is specified via an option passed to DS.belongsTo

Person=DS.Model.extend();
Group=DS.Model.extend({
people: DS.hasMany(Person
});
Person.reopen({
group: DS.belongsTo(Group, {nested:true})
});

with this definition and a group loaded into the store then group.get('people').createRecord({}) will Post to a nested resource url of /groups//person , and read, update, delete will behave accordingly too.