Using:
- ember.js commit b2e82ae
- ember-data.js commit 001ba0c
- handlebars-1.0.rc.2.js
This used to work already with the latest router API, but now breaks after upgrading to latest commit. This is also the first upgrade that tells me to use rc.2 for handlebars, that may be a hint.
The linkTo helper raises an error, when parsing the todo_items template: Uncaught TypeError: Cannot call method 'slice' of undefined
.
# router
App.Router.map(function() {
this.resource('todo_items', function() {
this.route('todo_item', {
path: '/:todo_item_id'
});
});
});
App.TodoItemsRoute = Ember.Route.extend({
model: function() {
return App.TodoItem.find();
}
});
# todo_items.handlebars
<ul>
{{#each item in content}}
<li>
{{#linkTo todo_items.todo_item item}}{{item.title}}{{/linkTo}}
</li>
{{/each}}
</ul>
It makes no difference when I wrap the first argument of linkTo in quotes: linkTo "todo_items.todo_item" item
, the same error occurres.
What am I doing wrong?