TypeError when implementing namespace
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.6k
- Forks
- 179
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Der Fehler tritt in app/views/admin/posts/index.ejs auf, wo pathTo.posts() aufgerufen wird. Überprüfe, wie Routen mit map.namespace in routes.js definiert sind und wie pathTo-Helper generiert werden. Suche nach vorhandenem Code zur Generierung von Route-Helpern, möglicherweise in lib/compound oder lib/compound/helpers. Prüfe, ob Namespace-Routen Helfer wie pathTo.adminPosts() erstellen. Starte die App, um den Fehler zu reproduzieren und zu sehen, welche Helfer im View-Kontext verfügbar sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, nodejs
- Bereich
- backend, documentation
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100