Permalink
Browse files

Fixed jade example

  • Loading branch information...
1 parent 27b1b5e commit 5dcc4f46db0ab500bd4622708bc66e94143ae43e @tj tj committed Apr 18, 2012
@@ -13,10 +13,9 @@ var pub = __dirname + '/public';
// and then serve with connect's staticProvider
var app = express.createServer();
-app.use(express.compiler({ src: pub, enable: ['sass'] }));
app.use(app.router);
app.use(express.static(pub));
-app.use(express.errorHandler({ dump: true, stack: true }));
+app.use(express.errorHandler());
// Optional since express defaults to CWD/views
@@ -43,32 +42,5 @@ app.get('/', function(req, res){
res.render('users', { users: users });
});
-app.get('/users/callback', function(req, res){
- // a callback is also accepted
- res.partial('users/user', users, function(err, html){
- if (err) throw err;
- res.send(html);
- });
-});
-
-app.get('/users', function(req, res){
- // we can use res.partial() as if
- // we were in a view, utilizing the same api
- // to render a fragment
- res.partial('users/user', users);
-});
-
-app.get('/users/list', function(req, res){
- // use "object" to utilize the name deduced from
- // the view filename. The examples below are equivalent
-
- //res.partial('users/list', { object: users });
- res.partial('users/list', { list: users });
-});
-
-app.get('/user/:id', function(req, res){
- res.partial('users/user', users[req.params.id]);
-});
-
app.listen(3000);
console.log('Express app started on port 3000');
@@ -1,3 +0,0 @@
-body
- :padding 50px 80px
- :font 14px "Helvetica Nueue", "Lucida Grande", Arial, sans-serif
@@ -1,4 +1,5 @@
-!!!
+!!! 5
html
include header
- body!= body
+ body
+ block content
@@ -1,3 +1,8 @@
-- if (users.length)
+
+extends ../layout
+
+block content
h1 Users
- #users!= partial('user', users)
+ #users
+ for user in users
+ include user
@@ -1,3 +0,0 @@
-ul#users
- - each user in list
- li!= partial('user', user)

0 comments on commit 5dcc4f4

Please sign in to comment.