emberjs/ember.js — pull request #2913 by machty (2013-06-29 02:20:30+00:00)
Title: router.js++: transitionTo/linkTo parameterize strings/numbers

This PR depends on https://github.com/tildeio/router.js/pull/32

This PR will convert string and number params of linkTo
and transitionTo into URL params that `model` will
use to fetch the model:

// Use posts.show's `model` hook to retrieve the model.
// 123 will be passed in as the post id
this.transitionTo('posts.show', 123);

{{linkTo 'posts.show' 123}}

{{#each relatedPosts}}
{{linkTo 'posts.show' id}}
{{/each}}

This prevents you from needing an object in order to
linkTo a dynamic route. It's also a good way to unify
model-fetching behavior by always letting `model` do
the loading work, which prevents you from having to
keep your `transitionTo`'s in sync with whatever
`model` does if you want the model loading behavior
to be the same.