Skip to content

Commit 61cb077

Browse files
committed
Jade templates
Added in a few elements
1 parent 03aca14 commit 61cb077

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

11_ExpressMultipleRoutes/routes/places.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var router = express.Router();
33

44
/* GET home page. */
55
router.get('/', function(req, res, next) {
6-
res.render('places', { title: 'Places I Plan on Visiting',
6+
res.render('places', { title: 'Places I Plan on Visiting',hasPlaces:true,
77
places:{1:{name:"Japan",url:"http://en.wikipedia.org/wiki/Japan"},
88
2:{name:"Scotland",url:"http://en.wikipedia.org/wiki/Scotland"},
99
3:{name:"Brazil",url:"http://en.wikipedia.org/wiki/Brazil"}}});

11_ExpressMultipleRoutes/views/index.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ extends layout
33
block content
44
h1= title
55
p Welcome to #{title}
6+
a.stacey(href="/places") Places

11_ExpressMultipleRoutes/views/places.jade

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ block content
1313
each val, index in places
1414
li
1515
a(href=val.url)= val.name
16-
16+
17+
div
18+
if hasPlaces
19+
a(href="/") Home
20+
1721

1822

0 commit comments

Comments
 (0)