2
我已经在我的余烬路线中嵌套资源。让我们假设根据this example,我router.js
样子:如何在Ember.js中定义嵌套资源的路由名称?
App.Router.map(function() {
this.resource('post', { path: '/post/:post_id' }, function() {
this.resource('comment', { path ':comment_id' });
});
});
的文件说,这应该产生这样的路线:
/post/:post_id post.index
/post/:post_id/:comment_id comment.index
不过,我想这是post.show
和comment.show
,我该如何重新命名这些路线?
我已经回答了您的问题。我的例子适合你? –
@MárcioRodriguesCorreaJúnior对于我来说,这不是一个解决方法。然而在你的JSbin例子中,评论没有列出,我不能确认它的工作。 – p1100i
是的,它就像一个解决方法,但我没有找到其他方法。你可以通过http://jsbin.com/ucanam/647#/post/1/1访问评论。或者点击Marcio链接http://jsbin.com/ucanam/647#/post/1 –