Question 1: Why needs ember-data revision 11 an underscored version of the attribute name?
Question 2: Is it a problem, if the attribute names are identical (without the underscore)?
Ember-Link: http://emberjs.com/guides/models/the-rest-adapter/
The Model
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
isPersonOfTheYear: DS.attr('boolean')
});
The JSON
{
"person": {
"first_name": "Barack",
"last_name": "Obama",
"is_person_of_the_year": true
}
}
The Mapping
App.Person = DS.Model.extend({
lastName: DS.attr('string')
});
DS.RESTAdapter.map('App.Person', {
lastName: { key: 'lastNameOfPerson' }
});
Thanks to all responder! :)