Consider having a Dynamic routing page at http://localhost:4200/organizer/{organizer-id} which fetches data from a RESTful JSONAPI adapter.
organizer.js:
export default Ember.Route.extend({
model: function(params) {
return this.get('store').findRecord('organizer', params.organizer_id);
}
});
Ember data pluralizes organizer into organizers when fetching data from the REST adapter. From the docs this seems to be the intended behavior, i.e. /organizers/{organizer-id}.
Yet, from their guide at https://guides.emberjs.com/v2.8.0/routing/defining-your-routes/, they seem to suggest this:
Router.map(function() {
this.route('posts');
this.route('post', { path: '/post/:post_id' });
});
Isn't this a contradiction? How can these routes be singular while the api endpoint above is pluralized?
/post/1, while it is/posts/1for API endpoints? - Oh Chin Booncowand see what the API endpoint is. - user663031