2

I'm trying to create a GUI for changing lots of attributes for lots of different models, from the single route.

So I've read a little about using multiple models [here].1

To give me the following:

    model: function() {

    return Ember.RSVP.hash({
        students: this.store.find('student'),
        objectives: this.store.find('objective')
    });
}

I was expecting that I could then display records etc with the following template code:

<h1>Objectives</h1>
{{#each objective in objectives}}
<p>{{objective.name}}</p>
{{/each}}

How should I access/display the records and their attributes in the template? Thanks

Community
  • 1
  • 1
rjoxford
  • 351
  • 3
  • 12

1 Answers1

3

You need to specify that you want the objectives on the model:

<h1>Objectives</h1>
{{#each objective in model.objectives}}
<p>{{objective.name}}</p>
{{/each}}
Oren Hizkiya
  • 4,420
  • 2
  • 23
  • 33