Model Fixtures ember rendered


#1

I want to change my models in a different way.

This is how it works using only Invoice Model

App.Invoice = DS.Model.extend({
  title       : DS.attr('string'),
  quantity    : DS.attr('string'),
  total       : DS.attr('string')
});

App.Invoice.FIXTURES = [
 {
   id: 1,
   title: 'Invoice',
   quantity: null,
   total: null
 }
];

Here where i can insert the value in the input and then see them rendered

 <td>{{input value=title}}</td>
 <td>{{input value=quantity}}</td>

  <p>Title: {{title}}</p>
  <p>Quantity:{{quantity}}</p>

You can see in action : http://jsbin.com/tiseju/2

Now i want change my models using also the Transaction Model, defining the attribute quantity and total to it and leaving the attribute title to Invoice

App.Invoice = DS.Model.extend({
  title         : DS.attr('string'),
  transactions  : DS.hasMany('transaction'),
  transactions: [1]
});

App.Transaction = DS.Model.extend({
  quantity: DS.attr('string'),
  total: DS.attr('string'),
  invoice: DS.belongTo('invoice')
});

App.Invoice.FIXTURES = [
 {
   id: 1,
   title: 'Invoice'
 }
];

App.Transaction.FIXTURES = [
 {
   id:1,
   quantity: '100',
 }
]; 

How can i iterate over it in my template now?


#2

I have figured it out, you can see here, if there is a better way i am open to other solutions http://jsbin.com/yuhemeyoye/1/edit?html,output