Species edit refactor (wip)

This commit is contained in:
Matthew Dillon 2015-07-06 11:02:41 -08:00
parent cdc825cc6a
commit 622cd0faaf
11 changed files with 155 additions and 124 deletions

View file

@ -5,10 +5,11 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
return Ember.RSVP.hash({
species: this.store.findAll('species'),
strains: this.store.findAll('strain'),
});
},
setupController: function(controller, model) {
controller.setProperties(model);
setupController: function(controller, models) {
controller.setProperties(models);
},
});

View file

@ -11,17 +11,18 @@
</tr>
</thead>
<tbody>
{{#each sortedSpecies as |row|}}
{{#each sortedSpecies as |species|}}
<tr>
<td>
<em>
{{#link-to 'species.show' row}}
{{row.speciesName}}
{{!-- use species.id to call show model hook --}}
{{#link-to 'species.show' species.id}}
{{species.speciesName}}
{{/link-to}}
</em>
</td>
<td>
{{#each row.strains as |strain index|}}
{{#each species.strains as |strain index|}}
{{if index ","}}
{{#link-to 'strains.show' strain.id}}
{{{strain.strainNameMU}}}