Good, yes. I understand your confusion.
What you have works great when you already have a lesson loaded with a course. When navigating directly to the lesson, you will need to get the course identifier from the URL and somehow pass it to the adapter. Obviously, there is no better solution to this; Here are a few options, in order of preference:
1. Do not use sub-URLs in the API
If you have control over the structure of your API, I recommend that you do not place your resources this way. It might make sense to load the collection subresource in a nested way (e.g. /courses/:course_id/lessons ), but /lessions/:lesson_id preferable to /courses/:course_id/lessons/:lesson_id .
However, you may not have control over your API, which is why ember-data-url templates were created ...
2. Use queryRecord
You can use queryRecord to load a single record and pass in additional information containing only an identifier.
// adapter export default AppAdapter.extend(UrlTemplates, { queryRecordUrlTemplate: '{+host}/courses/{course_id}/lesson/{lesson_id}', }); // route this.store.queryRecord('lesson', params);
3. Use the service
Another way to transfer information to your adapter is to use the service. This approach is not suitable for your situation, but I will include it here if it helps another similar problem. I often use the service to store general session information (e.g. user ID). Here, as you could do the same as above, using the session service:
// adapter export default AppAdapter.extend(UrlTemplates, { session: Ember.inject.service(), findUrlTemplate: '{+host}/courses/{courseId}/lesson/{id}', urlSegments: { courseId() { return this.get('session.courseId'); }, }, }); // somewhere else in your application this.set('session.courseId', params.course_id); // route model hook this.store.findRecord('lesson', params.lesson_id);
Hope this helps :)