Today I Learned

hashrocket A Hashrocket project

Always triggering the model hook in a route

In a link-to helper, many times you already have the model you're linking to in the Ember Data Store, so you pass in the model directly to the link-to. This will cause the route to skip the model hook because Ember Data already knows what the model is. If for some reason you want to ensure the model hook is always called, pass in model.id instead of model.

Just remember that this is done intentionally for performance, link-to model is always going to be faster than link-to model.id, because the model is already loaded.

See More #emberjs TILs