Search code examples
meteoriron-router

Meteor Iron Router does not get Current Path from Route


In a Template Helper I get the current path from Iron.Router (iron:router) as follows:

Router.current().route.path(this);

This works fine, unless the route path does contain parameters (e.g. /client/:_id/edit). In that case the path() function returns null.

How do I get the current path within a Template Helper, when the route contains parameters?

There are posts around covering the issue but the solution mentioned there seem not to fit.

I'm using Meteor 1.1.5 with iron:router1.0.7


Solution

  • According to this iron-router/issues/289 there are problems when the path contains parameters. The suggestion to use Iron.Location.get().path This works well for me.