Question with has_many


#1

Hi, I have this JSON:

    "questoes": [
        {
            "id": 122,
            "provas": [
                {
                    "id": 23,
                    "nome": "bla bla bla",
                }
            ]
   }
}

And my models:

App.Prova = DS.Model.extend({
  nome: DS.attr('string'),
  questao: DS.belongsTo('questao')
});

App.Questao = DS.Model.extend({
  nome: DS.attr('string'),
  provas: DS.hasMany('provas')
});

When I use this in view, notthing is displayed:

					{{#each prova in provas}}
						{{prova}}
					{{/each}}

How can I solve this problem ? Thanks.


#2

I think you should use prova’s attribute (in this case, prova.name .) rather then ‘prova’