You have several options.
Use buildURL()
In buildURL
you have access to record as the third option. With that you can do the following:
buildURL: function (type, id, record) {
return '/folders/' + id + '/items/' + record.get('item.id');
}
Send Links Metadata
You can implement an extractMeta
where you store off the href for this record. When you implement buildURL
you can just pull the metadata off the type. This is handy if you’re talking to a HAL JSON backend.
Synthetic Key
Instead of the backend issuing a single ID it can issue a sythentic id which is the combination of the 2 keys e.g. "12-42"
.
Here some more resources
http://codeofficer.com/blog/2013/10/03/ember-data-faking-a-composite-key.html