2

I've got a select-box with categories inside my post-editor. Ever since using the category permalink as its primary-key the selected value inside the select-field doesn't change anymore visible. However the value is updated correctly in the model.

What may cause this problem?

Everything used to work when permalink was just a property but not the primary key

The template

{{view "select"
  content=categories
  selection=model.category
  optionLabelPath="content.name"
  optionValuePath="content.id"}}

cateogries property in its controller

// categories for select-box
categories: function() {
  return this.get('store').find('category');
}.property(),

The category-model:

import DS from 'ember-data';
export default DS.Model.extend({
  name: DS.attr('string'),
  description: DS.attr('string'),
  posts: DS.hasMany('post',{async:true})
});

The category serializer:

import DS from 'ember-data';
export default DS.RESTSerializer.extend({
  primaryKey: 'permalink'
})
Sid
  • 2,683
  • 18
  • 22
Hedge
  • 16,142
  • 42
  • 141
  • 246

0 Answers0