0
module.exports = function routes() {
this.root('pages#main');
this.match('/status', 'pages#status');

this.resources('paper');
this.resources('tempform');
};

アプリケーションに「紙/ドメイン」を想定した新しい URL を追加するにはどうすればよいですか?

誰かがこれを追加する方法を説明できますか? 機関車ガイドを読みましたが、解決策がわかりません。

4

2 に答える 2

0

機関車のルートは で構成されconfig/routes.jsます。

this.match('pages/:home', { controller: 'PageController', action: 'show' });

そして、controllersディレクトリに新しいファイルを作成します

var PageController = new Controller();
module.exports = PageController;
PageController.show = function() {
  this.render();
}
于 2014-01-27T11:27:59.607 に答える