Permalink
Browse files

fixing express support. removing 'locals' stuff.

  • Loading branch information...
1 parent 57d59d0 commit 619898ce1d3e9a0283bdb02b8b07a2608cb1fcbf @paularmstrong committed Sep 18, 2011
Showing with 3 additions and 11 deletions.
  1. +2 −2 examples/express/server.js
  2. +1 −9 index.js
@@ -25,11 +25,11 @@ people = [
];
app.get('/people', function (req, res) {
- res.render('people', { locals: { people: people }});
+ res.render('people', { people: people });
});
app.get('/people/:id', function (req, res) {
- res.render('person', { locals: { person: people[req.params.id] }});
+ res.render('person', { person: people[req.params.id] });
});
app.listen(1337);
View
@@ -131,15 +131,7 @@ exports.compile = function (source, options, callback) {
if (typeof source === 'string') {
return function (options) {
var tmpl = exports.fromString(source);
-
- options.locals = options.locals || {};
- options.partials = options.partials || {};
-
- if (options.body) { // for express.js > v1.0
- options.locals.body = options.body;
- }
-
- return tmpl.render(options.locals);
+ return tmpl.render(options);
};
} else {
return source;

0 comments on commit 619898c

Please sign in to comment.