tmeasday / meteor-router

MIT License
366 stars 76 forks source link

Meteor.Router.to and also passing an ID #111

Closed FickleLife closed 11 years ago

FickleLife commented 11 years ago

Just starting off with Meteor and Router. From what I can see in the documentation Meteor.Router.to is quite simple, eg it doesn't pass other variables, jst straight routing to another resource:

Meteor.Router.to('raceAdd');

My raceAdd Meteor.Router.add (in routing.js) looks like this:

'/race/:_id/add': {
    to: 'raceAdd', 
    and: function(id) { Session.set('currentSeriesId', id); }    

Of course the ID doesn't get passed. What's the syntax for passing an ID using Meteor.Router.to?

tmeasday commented 11 years ago

There's a sentence about it right at the bottom of https://github.com/tmeasday/meteor-router#named-routes