Skip to content

Instantly share code, notes, and snippets.

@rizafahmi
Created August 25, 2015 00:04
Show Gist options
  • Save rizafahmi/160c450fe47799e027a9 to your computer and use it in GitHub Desktop.
Save rizafahmi/160c450fe47799e027a9 to your computer and use it in GitHub Desktop.
Add new telescope view
Telescope.menuItems.removeAll("viewsMenu");
Telescope.menuItems.add("viewsMenu", [
{
route: 'posts_all',
label: 'All',
description: 'All posts'
},
{
route: 'posts_best',
label: 'Best',
description: 'The all-time higest-rated videos'
},
]);
Posts.controllers.all = Posts.controllers.list.extend({
view: 'all'
});
Router.route('/all/:limit?', {
name: 'posts_all',
controller: Posts.controllers.all
});
Posts.views.add("all", function (terms) {
return {
find: {},
options: {sort: {createdAt: -1}}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment