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