I would like to ask a question about ember model and adapter. I have a model named account, used user creation. I would like not to use the model name in the url but when I try to create a user and communicate with the backend (http://ift.tt/1RMM3mT), ember keeps trying to connect to http://ift.tt/22WVRfC.
In the application RESTAdapter:
I have declare:
- host: 'http://127.0.0.1:8000',
- namespace: '/user'
and my buildURL is shown below:
buildURL: function(modelName, id, snapshot, requestType, query) {
var url = this._super(modelName, id, snapshot, requestType, query);
if (requestType == "createRecord" && modelName == "account") {
url = url + "register/"
}
return url;
}
Aucun commentaire:
Enregistrer un commentaire