Skip to content

Instantly share code, notes, and snippets.

@lamalex
Created May 22, 2013 00:29
Show Gist options
  • Save lamalex/5624379 to your computer and use it in GitHub Desktop.
Save lamalex/5624379 to your computer and use it in GitHub Desktop.
Meteor.Router.add ({
'/': 'relicsList',
'/page/:_id': {
to: 'relicPage',
and: function (id) { Session.set ('currentRelicId', id); }
},
'/forum/list': 'forumList',
'/forum/:name': {
to: 'threadList',
and: function (name) {
var forum = Forums.findOne({name: name});
if (forum) {
console.log(forum._id);
Session.set('currentPostId', forum._id);
Session.set('currentForumId', forum._id);
}
}
},
'/forum/:name/:_id': {
to: 'threadView',
and: function (name, id) {
Session.set('currentPostId', id);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment