Skip to content

Instantly share code, notes, and snippets.

@Streemo
Created October 25, 2014 21:28
Show Gist options
  • Save Streemo/96f44500c7b5e376c587 to your computer and use it in GitHub Desktop.
Save Streemo/96f44500c7b5e376c587 to your computer and use it in GitHub Desktop.
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
// function requireLogin(pause){
// if (!Meteor.userId()){
// if (Meteor.loggingIn()){
// this.render('loading');
// } else {
// this.render('accessDenied');
// }
// pause();
// }
// }
Router.map(function(){
this.route('postsList', {
path: '/',
});
this.route('postPage', {
path: '/posts/:_id',
data: function(){
return {
currentPost: Posts.findOne({_id: this.params._id}),
};
}
});
this.route('postSubmit', {
path: '/submit',
onBeforeAction: function(){
if (!Meteor.userId()){
this.template = 'accessDenied';
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment