I’m running into problems with links and transitions in the latest build of Ember.js (I just came from RC6, so this might be a simple fix). Whenever I supply a model to a link-to
helper or the transitionTo
function, Ember routes to the correct page, but the ID of the model is undefined in the URL (making it impossible to refresh). But when I use just the ID, it works fine. For instance, I have this afterModel
hook:
afterModel: function(resolvedModel, transition, queryParams) {
if (resolvedModel.get('length') === 1) {
this.transitionTo('organizations.organization.index', resolvedModel.get('firstObject'));
}
}
When the transition happens, it takes me to the correct page, but the URL comes out as /organizations/undefined
. However, if I add .get('id')
onto the second parameter and pass just the ID instead of the whole model, the ID comes out as it should: /ogranizations/ORG_1
. The same thing happens when using a link-to
helper.
Is this a bug, or just a feature of the 1.0 release? In RC6, I was definitely able to pass the model and not just the ID.