Odd {{link-to}} behaviour - not using the object's id property by default

This is strange behaviour and I wanted to see if this is right. When a pass a model (and just the model) to a the {{#link-to}} helper, I get the following error: Assertion Failed: You cannot pass 'undefined' as id to the store's find method

However, when I use model.id, the error doesn’t occur. Based on the documentation, I thought the {{#link-to}} helper was meant to use the id property by default?

That is how I understand it. I presume the find() call is in a model hook? It won’t even fire the model hook if you pass an object. What does your router look like? And I’d also suggest triple-checking the spelling of the object variable name you are passing in the link-to.

1 Like