collectionUrl, resourceUrl are ignored -> use namespace instead
mugwump opened this issue · 2 comments
Many thx for the example, that really got me going -
Alas, I tried it with the current version of ember-data(emberjs/data@bd9998f) and ran into some issues: It looks like the properties
collectionUrl: '/contacts',
resourceUrl: '/contacts/%@',
resourceName: 'contact'
on the Contact-Model are not supported by the curent rest-adapter. As far as I have seen, they are ignored completely - however the RestAdapter has gotten a builUrl-function that supports namespaces and suffixes. So, in order to get models running with a different resourceUrl, I had to set up the RestAdapter like this:
store = DS.Store.create
revision: 3,
adapter: DS.RESTAdapter.create({ bulkCommit: false, namespace: "admin" })
which now mounts the contacts into "/admin/contacts". As far as I could see, the RestAdapter does currently not support a configuration per model(correct me, If I'm wrong...). So, if somebody needs models from another namespace, this is the place to look into...
Cheers
Stefan
@mugwump - Thanks for the update and the tips!
I've been waiting for a couple key commits (mostly rollback support) to be added to ember-data before picking up this example again. There are quite a few PRs outstanding, including one for rollback support, which will hopefully be addressed soon. Once I get back to it, I'll look into the state of url support for the built-in rest adapter and try to get this whole thing working.
Sounds good! Drop me a line if I can help/test - I only just started with ember-data and examples are such a great help!