Skip to content
This repository

Modification + Merge of Pulls #764 + #755 #767

Closed
wants to merge 3 commits into from

2 participants

Jason Giedymin Jonathan Ong
Jason Giedymin

This pull puts together pulls #764 from @adrienbrault, #755 from @gdpotter and additional modifications missing from those pulls (such as updating broken example code, and generating the documentation).

JasonGiedymin added some commits
Jason Giedymin JasonGiedymin Pull #755 + layout-control example edit.
In addition to [pull #755](visionmedia#7
55) by @gdpotter, a modification was also necessary for the example "lay
out-control".
511a1cc
Jason Giedymin JasonGiedymin Pull #764 Docs change.
- [Pull #764](visionmedia#764) docs chan
ge from @adrienbrault
db94241
Jason Giedymin JasonGiedymin Regen guide doc.
- Regenerated guide.md doc file.
5512705
Jonathan Ong
Collaborator

sorry for the delay. the docs moved to https://github.com/visionmedia/expressjs.com!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 3 unique commits by 1 author.

Jul 21, 2011
Jason Giedymin JasonGiedymin Pull #755 + layout-control example edit.
In addition to [pull #755](visionmedia#7
55) by @gdpotter, a modification was also necessary for the example "lay
out-control".
511a1cc
Jason Giedymin JasonGiedymin Pull #764 Docs change.
- [Pull #764](visionmedia#764) docs chan
ge from @adrienbrault
db94241
Jason Giedymin JasonGiedymin Regen guide doc.
- Regenerated guide.md doc file.
5512705
This page is out of date. Refresh to see the latest.
2  docs/guide.html
@@ -386,7 +386,7 @@ <h3 id="routing">Routing</h3>
386 386 });
387 387 </code></pre>
388 388
389   -<p>A route is simple a string which is compiled to a <em>RegExp</em> internally. For example
  389 +<p>A route is a simple string which is compiled to a <em>RegExp</em> internally. For example
390 390 when <em>/user/:id</em> is compiled, a simplified version of the regexp may look similar to:</p>
391 391
392 392 <pre><code>\/user\/([^\/]+)\/?
2  docs/guide.md
Source Rendered
@@ -124,7 +124,7 @@ are available as `req.params`.
124 124 res.send('user ' + req.params.id);
125 125 });
126 126
127   -A route is simple a string which is compiled to a _RegExp_ internally. For example
  127 +A route is a simple string which is compiled to a _RegExp_ internally. For example
128 128 when _/user/:id_ is compiled, a simplified version of the regexp may look similar to:
129 129
130 130 \/user\/([^\/]+)\/?
4 examples/layout-control/app.js
@@ -10,7 +10,7 @@ var app = express.createServer();
10 10 app.set('views', __dirname + '/views');
11 11
12 12 // set default layout, usually "layout"
13   -app.local('layout', 'layouts/default');
  13 +app.locals({'layout': 'layouts/default'});
14 14
15 15 // Set our default template engine to "ejs"
16 16 // which prevents the need for extensions
@@ -29,4 +29,4 @@ app.get('/alternate', function(req, res){
29 29 });
30 30
31 31 app.listen(3000);
32   -console.log('Express app started on port 3000');
  32 +console.log('Express app started on port 3000');
6 lib/view.js
@@ -353,6 +353,9 @@ res._render = function(view, opts, fn, parent, sub){
353 353 // merge render() .locals
354 354 if (opts && opts.locals) merge(options, opts.locals);
355 355
  356 + // Merge view locals
  357 + union(options, locals);
  358 +
356 359 // status support
357 360 if (options.status) this.statusCode = options.status;
358 361
@@ -382,9 +385,6 @@ res._render = function(view, opts, fn, parent, sub){
382 385 // charset option
383 386 if (options.charset) this.charset = options.charset;
384 387
385   - // Merge view locals
386   - union(options, locals);
387   -
388 388 // Always expose partial() as a local
389 389 options.partial = function(path, opts){
390 390 return renderPartial(self, path, opts, options, view);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.