-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
Hello !
I was looking for a way of having a dynamic part in my model's url. Something like this :
import Ember from "ember";
MyModel = Ember.Model.extend({
// Relations and stuff
some_resource: Ember.belongsTo("some-resource", { primaryKey: 'id' }),
});
MyModel.url = "/some_resource/:id/other_resource" // post/:id/comment for instance
MyModel.adapter = Ember.RESTAdapter.create();
export default MyModel;But that does not work from the get go obviously. I thought of overwriting the buildURL function in my own adapter but we only get the record (before it's fetched, with nothing but a primary key) and I can't manage to get its belongsTo. Is there a built in way to do this or should there be one ?
Thanks !
Metadata
Metadata
Assignees
Labels
No labels