Permalink
Browse files

revert to non OOP 3.0.0 Express. Lets try again

  • Loading branch information...
1 parent 921deb0 commit cba9a50fac243eb15a3ad8e8e005c2af44ad2a6e @pauliusuza pauliusuza committed Mar 29, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −1 lib/application.js
  2. +8 −1 lib/view.js
View
2 lib/application.js
@@ -512,7 +512,7 @@ app.render = function(name, options, fn){
if (!view) {
view = new View(name, {
defaultEngine: this.get('view engine')
- , defaultLayout: this.get('view layout') || 'layout'
+ defaultLayout: this.get('view layout') || 'layout'
, root: this.get('views') || process.cwd() + '/views'
, engines: engines
});
View
9 lib/view.js
@@ -84,7 +84,14 @@ View.prototype.render = function(options, fn){
var self = this;
self.engine(self.path, options, function(err, res) {
- var layout = options.layout || self.defaultLayout;
+
+ var layout;
+ if(options.layout == false) {
+ layout = false;
+ } else {
+ layout = options.layout || self.defaultLayout;
+ }
+
var extension = options.engine || self.defaultEngine;
/* Expose render function to views for subview rendering */

0 comments on commit cba9a50

Please sign in to comment.