Route's model hook doesn't fire when link is clicked


#1

I’m building a simple app using Ember Data (see here for background). In my CategoryRoute I’m trying to load a single model containing the category (passed in via the link-to helper), as well as another model containing items found within that category (Items). Currently when I click into the route from a link-to help (passing a model), the model hook does not fire. As explained to me in the previous post, this is because the model is already being provided. When the page is reloaded the model hook fires as expected and my data loads in as expected.

I’m trying to find out how I can get around this behaviour. The app is still in it’s beginning stages so I’m willing to rewrite parts of it if there’s a more accepted approach to this need.


Ember Data is passing a query param instead of accessing an API endpoint. Can you help?
#2

Can you post the code for the link-to? Try passing just the id instead of the entire object.

For example,

Try this: {{#link-to ‘category’ this.id}}

instead of {{#link-to ‘category’ this}}


#3

MIKE! That’s awesome, thank you. It works perfectly, and makes so much sense!