【发布时间】:2014-06-02 13:33:29
【问题描述】:
以下路由设置来自 Ember.JS 文档 (http://emberjs.com/guides/routing/defining-your-routes/),我必须处理一个等效问题:
App.Router.map(function() {
this.resource('post', { path: '/post/:post_id' }, function() {
this.route('edit');
this.resource('comments', function() {
this.route('new');
});
});
});
根据文档和我自己的经验,这会导致以下路径:
/post/:post_id/comments -> App.CommentsIndexRoute
但是,由于我想要一个特定于帖子的评论路线,我本来希望
/post/:post_id/comments -> App.PostsCommentsRoute
我的谬误到底是什么,我必须改变什么才能实现我的目标。
【问题讨论】:
标签: javascript ember.js routes