TypeError when implementing namespace
- 主要言語
- JavaScript
- スター
- 1.6k
- フォーク
- 179
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
It would be awesome to be able to `compound g crud "admin/posts" stuff`. Since #93 is closed I assumed it was implemented, but apparently it's not.
When I try to implement a namespace manually, after running `compound g crud post title content` and moving post controllers and views to admin/posts, I get the following error:
> TypeError: /Users/andreashultgren/Documents/Projects/Private/compound-test/app/views/admin/posts/index.ejs:3 1|
5| 6|With the following in routes (according to the docs):
``` javascript
map.namespace('admin', function (admin) {
admin.resources('posts');
});
```
pathTo is not mentioned in the docs.
Some tests covering namespaces would have helped me to figure out what's wrong, but I can't find any of those either.
Is there an example with namespace actually implemented somewhere?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
エラーは app/views/admin/posts/index.ejs で pathTo.posts() が呼び出された際に発生します。routes.js で map.namespace を使用してルートがどのように定義されているか、また pathTo ヘルパーがどのように生成されているかを確認してください。既存のルートヘルパー生成コードを探します。lib/compound または lib/compound/helpers にある可能性があります。ネームスペースルートが pathTo.adminPosts() のようなヘルパーを作成するかどうかを確認します。アプリを実行してエラーを再現し、ビューコンテキストで利用可能なヘルパーを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, nodejs
- 領域
- backend, documentation
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100