I’m new in the ember world and have some difficulties with where to put what. Maybe for someone it will be peace of cake.
Any way I have managed to create my first app, that loads json data form the server. However later on the structure of json has been changed and I cannot figure out how to solve that in ember models or in any other way.
For Ember conventions everything is ok with users array, but what to do with error?
Should I write a serializer? Or should error be defined as a model?
If you don’t want Ember Data to try to convert error into a model, then you can just remove it from the payload before that happens. I usually do that in ApplicationSerializer#extractMeta(store, type, payload).
Thanks for replay.
The idea suits me, but I do not know if that is working. But that I think is my poor knowledge of ember.
Where should the model’s serializer be defined?
It is hard to find working example of serializers. Ive structured my ember app as ember-rails generator did. And my user model:
I’ve used few different tutorials and tried to keep code as similar as http://emberjs.com/guides/. But to have global picture I have used some tutorials that are 3-6 months old. And that I see is the main problem.
Maybe you can suggest some guides that could lead me to more info?
I think I will start the app from scratch while it is still in early stages. Because ember data is very promising.
The Ember Models section in Ember Guides is the best collection of resources on the current state of Ember Data. For more succinct reference, you should look at the Ember Data betas slideshow by Yehuda Katz. TRANSITIONS.md is probably the most comprehensive summary of how to use Ember Data.