Created
July 30, 2014 13:23
-
-
Save artcommacode/3ba23b50be5b65976723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first | |
// render is set on this in app.use(), vPath (view path) is set at top of file | |
// locals sit in `this.locals` and can be easily merged | |
this.body = yield this.render(vPath + 'index', {users: users}) | |
// second | |
// render is required at the top of the file with the view path, | |
// need to pass in `this` to merge `this.locals` | |
this.body = yield render.call(this, 'index', {users: users}) | |
// third | |
// merge locals before sending them off to be rendered | |
this.body = yield render('index', merge({users: users}, this.locals)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment