TypeError when implementing namespace
- Lingua principale
- JavaScript
- Stelle
- 1.6k
- Fork
- 179
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
L'errore si verifica in app/views/admin/posts/index.ejs dove viene chiamato pathTo.posts(). Controlla come le route sono definite con map.namespace in routes.js e come vengono generati gli helper pathTo. Cerca il codice esistente per la generazione degli helper di route, possibilmente in lib/compound o lib/compound/helpers. Verifica se le route del namespace creano helper come pathTo.adminPosts(). Esegui l'app per riprodurre l'errore e vedere quali helper sono disponibili nel contesto della vista.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, nodejs
- Ambito
- backend, documentation
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100