Created
November 29, 2012 07:33
Revisions
-
kasima renamed this gist
Nov 29, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kasima revised this gist
Nov 29, 2012 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ Meteor.Router.add({ '/posts': 'posts', '/posts/:id': 'post', '/authors/:id': 'author' }); Template.post.post = function () { return Posts.findOne(Session.get('params').id); }; Template.author.author = function () { return Authors.findOne(Session.get('params').id); }; -
kasima renamed this gist
Nov 29, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kasima created this gist
Nov 29, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ Meteor.Router.add({ '/posts': 'posts', '/posts/:id': function(id) { Session.set('postId'); return 'post'; }, '/authors/:id': function(id) { Session.set('authorId', id); return 'author'; } }); Template.post.post = function () { return Posts.findOne(Session.get('postId')); }; Template.author.author = function () { return Authors.findOne(Session.get('authorId')); };