断言失败:错误:断言失败:URL“/ posts.index”与应用程序中的任何路由都不匹配

时间:2014-02-21 08:48:01

标签: ember.js

我发现了一个线程,我应该实现Post Route,但是我得到了更多的错误。有人有想法吗?

App = Ember.Application.create({
   LOG_TRANSITIONS: true
});

App.Router.map(function() {
   // put your routes here
   //this.resource("projects", function() {});
   this.resource('posts', function() {});
   this.resource('projects');
});

App.PostsRoute = Ember.Route.extend({});

1 个答案:

答案 0 :(得分:0)

我相信posts.index只有在posts嵌套的子路线时才会被创建(根据您发布的代码,您似乎没有。请尝试将链接替换为{ {1}} posts.index