following that instructions: https://github.com/emberjs/data/blob/master/TRANSITION.md#embedded-records
receiving this json from the server
{
"installazioni": [{
"id": "25",
"descrizione": "Installazione 25",
"prodotto_id": "19",
"venditore_id": "0",
"created_at": "2013-09-25 17:10:02",
"updated_at": "2013-09-26 14:45:44",
"prodotto": {
"id": "19",
"nome": "Prodotto 19",
"descrizione": "",
"installabile": "0",
"created_at": "2013-09-25 17:10:44",
"updated_at": "2013-09-25 17:10:44"
}
}]
}
I’m developing this serializer
Wus.InstallazioneSerializer = DS.RESTSerializer.extend({
extractSingle: function(store, type, payload, id, requestType) {
var prodotto = payload.installazione.prodotto,
prodottoId = prodotto.mapProperty('id');
payload.prodotto = prodotto;
payload.installazione.prodotto = prodottoId;
return this._super.apply(this, arguments);
}
});
but I receive that errors on the console
Error while loading route: TypeError {} ember.js:394
Uncaught TypeError: Cannot call method 'toString' of undefined ember-data.js:2354
To be true i receive that errors also without serializer… so, any ideas of where can be the problem?
thanks in advance