I am currently having problems selecting items in multi-segment view. I am using ember 1.3 with ember-data 1.0.0 beta 6 and ember-data-django-rest-adapter.
App.Article = DS.Model.extend({
title: attr(),
description: attr(),
authors: hasMany('author')
});
App.ArticleRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('article', params.article_id);
},
setupController: function(controller, model) {
controller.set('content', model);
}
});
App.ArticleController = Ember.ObjectController.extend({
needs: ['authors'],
allAuthors: function() {
return this.store.find('author');
}.property()
});
Template:
{{input authors as='select'
multiple='true'
collection='allAuthors'
selection='authors'
optionValuePath='content.id'
optionLabelPath='content.name'}}
I'm not sure why this does not work, because when I output allAuthors and authors using #each in the template, I get the data I need.
Is there something I am missing?
Thanks in advance for your help.
source
share