I have an app
resource that is loaded with the route /apps/1
. I’d like to display some metrics about the app, so I created the route:
this.resource("apps", function() {
this.route('show', { path: ':app_id' }, function() {
this.resource('metrics', function() { });
});
});
I’m confused at how to get the app to call the metrics
api endpoint. I’ve tried doing:
model: function() {
return this.modelFor('apps/show').get('metrics');
}
with:
metrics: DS.hasMany('metric', {async: true}),
But my understanding is because there are no embedded IDs to metrics
in the show
response from the server, ember data doesn’t know what to request. The metrics resource is kind of loosey-goosey. It’s returning data that’ll be use to build a graph for visualization.
Is there a way to NOT embed IDs and still get ember to always request the additional data on the /metrics
endpoint?