Reputation: 371
When I am using route without params, I've got normal pathFor in my template. But when I am adding some "slug", like this:
@route "pagesSlug",
path: "/page/:_slug"
name: "page"
And got error in console:
You called Router.path for a route named page but that route doesn't seem to exist. Are you sure you created it?
No change when I add/remove name. I've got empty {{pathFor ... in my template, and urlFor too empty.
In this case:
@route "articlesList",
path: "/articles"
waitOn: ()->
Meteor.subscribe 'articles'
I've got href="/articles" - no problem.
Update: Meteor 0.9.4, and 0.9.4 of Iron-Router.
Upvotes: 0
Views: 294
Reputation: 93754
The first parameter of the route function is the name of the route. Your route name is pagesSlug
To get the path by the pathFor
helper, you need to also pass the parameter _slug
{{pathFor "pagesSlug" _slug="xxxx"}}
Upvotes: 1