Reputation: 2461
I have an ember application with a few different models. All bar one model pull data from an api at http://example.com/version1/123/. However, one model needs to pull from http://example.com/version1/dogs/123. Is it possible to add a custom url for one model? I've tried changing my store.js file as follows-
App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'http://example.com/version1/123/'
});
App.Store.registerAdapter('App.Dogs', DS.RESTAdapter.extend({
host: 'http://example.com/version1/dogs/123'
}));
but it hasn't had an effect. Any suggestions?
Upvotes: 1
Views: 410
Reputation: 428
If I understand the question correctly, something like this should work
App.DogAdapter = DS.RESTAdapter.extend({
host: 'http://example.com/version1/dogs/123'
});
I have it setup personally with namespace over host like this.
App.DogAdapter = DS.RESTAdapter.extend({
namespace: "version1/dogs"
});
Upvotes: 1
Reputation: 47367
remove the register adapter and just create a custom adapter for dogs (This might need to be singular)
App.DogsAdapter = DS.RESTAdapter.extend({
host: 'http://example.com/version1/dogs/123/'
});
Upvotes: 3