Permalink
Browse files

Moved automatic views config to configuration API

  • Loading branch information...
1 parent a345b35 commit c94f167b79fcd6836a29d8c4d2ca73a7d0de3f09 @chetan51 committed Nov 20, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/ni.js
View
@@ -54,7 +54,8 @@ var Ni = function() {
* Default configuration settings
*/
- this.automatic_views = false;
+ // Whether to use automatic views by default
+ this.config('automatic_views', false);
/*
* Tells Ni what root directory to look into.
@@ -114,7 +115,7 @@ var Ni = function() {
controller,
fn;
- res.Ni = { view: Ni.automatic_views };
+ res.Ni = { view: Ni.config('automatic_views') };
args.unshift(next);
args.unshift(res);
@@ -176,7 +177,7 @@ var Ni = function() {
this.renderView = function (renderer) {
if (typeof(renderer) === 'function') {
- Ni.automatic_views = true;
+ Ni.config('automatic_views', true);
return function (req, res, next) {

0 comments on commit c94f167

Please sign in to comment.