Calling serializer's extract methods

86 Views Asked by At

I want to overwrite either extractSingle or extractSave from the DS.RESTSerializer. What to do after this? Do I call those method in my controller to retrieve json data? What is the correct way to retrieve the datas from calling those methods?

1

There are 1 best solutions below

4
On BEST ANSWER

If Ember uses your serializer, according to convention, you never explicitly call those methods. They will be called by Ember directly. The adapter will make the REST call and then use the object's serializer to extract arrays and/or single objects.

The objects extracted will then be put into the store (either inserting or replacing existing objects according to ID). You will then retrieve them in your Route by calling store.find('modeltype').