The question is, why did I have to wrap everything in "hash"? In other words, can anyone explain var opts = options && options.hash; (line 32 of lib/helpers.js)? It seems this replaces options with options.hash but ... why? Is there something magic about helpers I don't understand? There is similar code in urlFor, but something else in linkTo.
As an aside, it's be really nice to have a function like the above in the API, unless Meteor someday allows calling helpers from each other... Essentially, Router.go but returning a URL instead of going there.
I've found that I can call the pathFor helper from another helper using the following CoffeeScript function:
The question is, why did I have to wrap everything in "hash"? In other words, can anyone explain
var opts = options && options.hash;
(line 32 of lib/helpers.js)? It seems this replaces options with options.hash but ... why? Is there something magic about helpers I don't understand? There is similar code in urlFor, but something else in linkTo.As an aside, it's be really nice to have a function like the above in the API, unless Meteor someday allows calling helpers from each other... Essentially,
Router.go
but returning a URL instead of going there.