Rough in characteristic types, add meas optgroups

This commit is contained in:
Matthew Dillon 2015-06-16 15:47:29 -08:00
parent f17707fb6d
commit 3c1fca43b8
9 changed files with 126 additions and 20 deletions

View file

@ -3,14 +3,17 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
return this.store.findAll('characteristic');
return Ember.RSVP.hash({
characteristicTypes: this.store.findAll('characteristic-type'),
characteristics: this.store.findAll('characteristic'),
});
},
setupController: function(controller, model) {
setupController: function(controller, models) {
var tableAttrs = [
{ name: 'Name', attr: 'characteristicName' },
{ name: 'Type', attr: 'characteristicType' }
{ name: 'Type', attr: 'characteristicType.characteristicTypeName' }
];
controller.set('model', model);
controller.set('model', models.characteristics);
controller.set('tableAttrs', tableAttrs);
controller.set('row', 'characteristic-index-row');
controller.set('sort', ['characteristicName']);