Skip to content

Instantly share code, notes, and snippets.

@BenjaminRH
Created August 28, 2013 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjaminRH/6369913 to your computer and use it in GitHub Desktop.
Save BenjaminRH/6369913 to your computer and use it in GitHub Desktop.
Meteor.Router.add({
'/': {
to: 'index',
and: function () {
Session.set('genre', null);
}
}, // site index
'/:action/:action2/:action3': function (action, action2, action3) {
var genreSession = null,
template = 'index';
/** process all genres */
if (_.contains(genresA, action)) {
genreSession = action;
template = 'list';
}
if (action2 === 'battle' && !_.isEmpty(action3)) {
Session.set('currentBattleSlug', action3);
template = 'battle';
}
/** end */
//if (genreSession !== null)
Session.set('genre', genreSession);
/** return index page as default when 404 */
return template;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment