Permalink
Browse files

Add root dir to automatic view filenames

  • Loading branch information...
1 parent b18adf6 commit 38b07fa3fa170a24a85890a6dbca22f698fdbf2a cloud9 committed Nov 23, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/ni.js
View
@@ -136,11 +136,12 @@ var Ni = function() {
}
this.view = function (renderer) {
+ var root = this.__root + '/views/';
if (typeof(renderer) === 'function') {
Ni.automatic_views = true;
return function (req, res, next) {
if (res.Ni.view && typeof(res.Ni.action) !== 'undefined') {
- renderer(req, res, next, res.Ni.controller + '/' + res.Ni.action);
+ renderer(req, res, next, root + res.Ni.controller + '/' + res.Ni.action);
} else {
next();
}

0 comments on commit 38b07fa

Please sign in to comment.