I have a model that looks like:
export default DS.Model.extend({
ordernumber: DS.attr('string'),
allowMeasurementsFrom: DS.attr('date'),
devices: DS.hasMany('device', { async: true })
});
And when I do a request to a page that is about one order I get these requests:
GET "http://localhost:51799/devices/0fd27d12-fd25-412d-bcf6-6e84064bd951".
GET "http://localhost:51799/devices/a84142bd-b314-4e6e-a29f-6821fb7f32fb".
GET "http://localhost:51799/devices/3b1ed530-1cf6-42fb-90b7-f1d4886dce05".
But I expected a request with multiple ids, like it says in the docs here. Like:
GET "http://localhost:51799/devices?ids[]=3b1ed530-1cf6-42fb-90b7-f1d4886dce05&ids[]=a84142bd-b314-4e6e-a29f-6821fb7f32fb&ids[]=3b1ed530-1cf6-42fb-90b7-f1d4886dce05".
And this is my template:
{{id}}
{{#each dev in devices}}
<img {{bind-attr src=dev.image}}>
{{dev.deviceId}}
{{/each}}
I've tried looping through the devices directly and getting them in the controller first and then, looping through the devices. In both cases it does n
requests.
I'm using the DS.RESTAdapter
. Versions: Ember: 1.10.0 Ember Data: 1.0.0-beta.15
devices
in a template, or by usingorder.get('devices')
? – GJK{{#each}}
but I also tried{{devices}}
but that just prints something likeDS.PromiseArray
. – albertjan