I have an Ember.js application with a navbar at the top. One of the buttons goes to /home
while another goes to /book/:id/overview
. If I'm on the /home
page, the button renders fine. If I hover over the button, I can see that the link will take me to /book/2/overview
. If I copy the link location and paste it into the address bar, it will take me to /book/2/overview
. BUT, if I simply click the link, I get taken to /book/undefined/overview
. The link is clearly pointing to the right location, yet Ember.js is taking me to the wrong one. (Or more specifically, it doesn't seem to be finding the model, even though it finds it just fine if I manually type in the ID.)
What could possibly be going wrong?
(I'll post some code as soon as I know the relevant bits. It seems like it could be so many things at this point.)
serialize
method. If theid
property of the model you need a customserialize
implementation. But if you are getting the correct URL on hover, this should just work. Try verifying that the model you are passing tolinkTo
has anid
. – Darshan Sawardekar