I'm using a rest adapter with ember-data 1.0 and ember.js 1.0
given these models:
App.Customer = DS.Model.extend({
name: DS.attr('string'),
state: DS.belongsTo("State")
});
App.State = DS.Model.extend({
region: DS.attr('string'),
state: DS.attr('string'),
stateName: DS.attr('string'),
customers: DS.hasMany("Customer")
});
when I go to /#/states, I get this json response
{
"states": [
{
"region": "West",
"state": "AZ",
"stateName": "Arizona",
"id": "0x0000000000000324",
"customers": [
"0x00000000000001e5"
]
},
{
"region": "West",
"state": "CA",
"stateName": "California",
"id": "0x0000000000000325",
"customers": [
"0x00000000000001c0",
"0x00000000000001c4",
"0x00000000000001d4"
]
}
]
"customers" : [
{
}
]
}
Now, I have a couple of questions
1) What should I put in the Customers part ? A complete list of all the customers, or just a list of the customers that are specified in the state list ?
2) what data should I send back if I visit /#/customers ?
3) If I were to edit a customer. would I set it up so that the lookup/combo makes a separate request to the server ?
thanks for the help !