Permalink
Browse files

Routing to a single post page

chapter5-3
  • Loading branch information...
tmeasday committed Nov 12, 2013
1 parent 6f44634 commit 7b9264db77678434ed48750625a57716f65869e8
Showing with 11 additions and 0 deletions.
  1. +1 −0 client/templates/posts/post_item.html
  2. +5 −0 client/templates/posts/post_page.html
  3. +5 −0 lib/router.js
@@ -3,5 +3,6 @@
<div class="post-content">
<h3><a href="{{url}}">{{title}}</a><span>{{domain}}</span></h3>
</div>
+ <a href="{{pathFor 'postPage'}}" class="discuss btn btn-default">Discuss</a>
</div>
</template>
@@ -0,0 +1,5 @@
+<template name="postPage">
+ <div class="post-page page">
+ {{> postItem}}
+ </div>
+</template>
View
@@ -5,3 +5,8 @@ Router.configure({
});
Router.route('/', {name: 'postsList'});
+
+Router.route('/posts/:_id', {
+ name: 'postPage',
+ data: function() { return Posts.findOne(this.params._id); }
+});

0 comments on commit 7b9264d

Please sign in to comment.