1602 / compound

MVC framework. Built on Node.JS. Works on server and browser.
http://compoundjs.com
1.6k stars 183 forks source link

TypeError when implementing namespace #564

Open ahultgren opened 11 years ago

ahultgren commented 11 years ago

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):

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?

ahultgren commented 11 years ago

Found the error. It's what's suggested here except is has to be done in the views to... I still think the generator should be able to handle this, and at least it could be mentioned in the docs.