I am trying to use a Ember.Select on a boolean attribute on my model. The problem is that it is converting my attribute to an object {} and no binding occurs.
My model has an isActive flag
isActive: DS.attr('boolean'),
Here is the ember select in my template
{{view Ember.Select
viewName="isActive"
content=controller.yesNo
optionLabelPath="content.key"
optionValuePath="content.value"
selection=model.isActive
class="form-control"
disabled=true}}
In my router I set the yesNo array on the controller (as an aside, I am not sure if this is the correct place to do this, this one is simple but some of my selects require querying the database using this.store.find('accounts')
so I think these go in the route not the controller).
setupController: function(controller, model) {
this._super(controller, model);
controller.set('yesNo', [
{key : 'Yes', value : true},
{key : 'No', value : false}
]);
}
I have also tried passing the boolean values as string but it does not work.
controller.set('yesNo', [
{key : 'Yes', value : 'true'},
{key : 'No', value : 'false'}
]);
update
From ember inspector, when I select an item it is returning the whole object { key: Yes, value: true }
or { key: No, value: false }
. I wan't it to return the value property only.