Skip to content

Instantly share code, notes, and snippets.

@tanis2000
Created November 28, 2014 13:57
Show Gist options
  • Save tanis2000/aefd0c3abdb381ee4d87 to your computer and use it in GitHub Desktop.
Save tanis2000/aefd0c3abdb381ee4d87 to your computer and use it in GitHub Desktop.
Router.configure({
layoutTemplate: 'layout',
notFoundTemplate: 'not_found',
waitOn: function () {
return [ Meteor.subscribe('currentUser')];
},
load: function() {
}
});
Router.route('/', function() {
this.render('home');
});
Router.route('/admin/surveys', {
waitOn: function() {
return Meteor.subscribe('surveys');
},
data: function() {
return { items: App.Model.Surveys.find({}), name: 'Survey', fields:['title'], collection: App.Model.Surveys};
},
action: function() {
this.render('admin_list');
}
});
Router.route('/admin/users', {
waitOn: function() {
return Meteor.subscribe('users');
},
data: function() {
return { items: Meteor.users.find({}), name: 'User', fields:['username'], collection: Meteor.users};
},
action: function() {
this.render('admin_list');
}
});
Router.route('/test', function() {
this.response.end("test\n");
}, {where: 'server'});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment