我理解路由是用于将URL映射到模板的,但显然你可以使用this.route或者this.resource来定义路由。
App.Router.map(function() {
this.route("about", { path: "/about" });
this.route("favorites", { path: "/favs" });
});
App.Router.map(function() {
this.resource('posts', { path: '/posts' }, function() {
this.route('new');
});
});
如果您想定义子路由到一个路由,您是否只需使用this.resource,还是有其他原理我没有理解的?
/contacts/<contact_id>/edit
(就像这里)link怎么办? - Marco Petersen