Skip to content

Commit

Permalink
Enable layout overrides from controller like express.
Browse files Browse the repository at this point in the history
Something causes the app to hang unless we delete the layout key from data on render.
  • Loading branch information
KevinGrandon committed Feb 11, 2012
1 parent c5cbc0b commit 9e2f182
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ module.exports = Class(function (req, res, next) {
}
, render: function (view, data, fn) {
data = data || {}
layout = data.layout || this.layout
delete data.layout
this.response.render(this.viewFolder + view, {
layout: this.layout
layout: layout
, locals: data
, partials: pr.get(this.viewFolder, app.set('viewPartials'))
}, fn)
Expand Down

0 comments on commit 9e2f182

Please sign in to comment.