【发布时间】:2014-01-08 15:02:27
【问题描述】:
我刚刚启动 Ember,但遇到了名为 posts.images 的路由问题。
在我的路由器中,我有:
this.resource('posts', function(){
this.resource('images', { path: ':post_id' });
this.resource('newpost', { path: 'new' });
this.resource('post', { path: ':post_id' });
});
我的路线是:
Hex.PostImagesRoute = Ember.Route.extend({ // same with Hex.PostsImagesRoute
model: function(params) {
console.log('alert postimages');
return Hex.Post.findById(params.post_id);
}
});
在我的模板中我有:
{{#link-to 'posts.images' id}}images{{/link-to}}
但我收到以下错误:
Assertion failed: The attempt to link-to route 'posts.images.index' failed. The router did not find 'posts.images.index' in its possible routes: 'loading', 'e
我已阅读http://emberjs.com/guides/routing/defining-your-routes/,但不确定我做错了什么。任何帮助,将不胜感激。
谢谢
【问题讨论】:
标签: ember.js