TypeError when implementing namespace
- Langage dominant
- JavaScript
- Étoiles
- 1.6k
- Forks
- 179
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
L'erreur se produit dans app/views/admin/posts/index.ejs où pathTo.posts() est appelé. Vérifie comment les routes sont définies avec map.namespace dans routes.js et comment les helpers pathTo sont générés. Cherche le code existant de génération de helpers de route, probablement dans lib/compound ou lib/compound/helpers. Vérifie si les routes de namespace créent des helpers comme pathTo.adminPosts(). Lance l'application pour reproduire l'erreur et voir quels helpers sont disponibles dans le contexte de la vue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, nodejs
- Domaine
- backend, documentation
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100