lundi 29 juin 2015

Ember.js: there is no route named 'new-table'

Here are my routes definition:

Router.map(function() {
    this.resource('servers', { path: '/' }, function() {
      this.resource('server', { path: '/servers/:serverid'}, function () {
          this.resource('databases', { path: '/databases' }, function () {
              this.resource('database', { path: '/:databaseid'}, function () {
                  this.resource('catalogues', { path: '/catalogues' });
                  this.resource('eventtriggers', { path: '/eventtriggers' });
                  this.resource('extensions', { path: '/extensions' });
                  this.resource('schemas', { path: '/schemas' }, function () {
                      this.resource('schema', { path: '/:schemaid' }, function () {
                          this.resource('tables', { path: '/tables' }, function () {
                              this.route('new-table', function () {});

                              this.resource('table', { path: '/:tableid' });
                          });
                      });
                  });
                  this.resource('replication', { path: '/replication' });
              });
          });
      });
    });
});

And the code used to generate link to new-table route goes as follows:

{{#link-to 'new-table' schema.database.server.id schema.database.id schema.id}}

And this gives me the error mentioned in this question's topic. However when I replace this.route call to this.resource everything works fine. So what am I doing wrong here? I'm using ember 1.13.2.




Aucun commentaire:

Enregistrer un commentaire