meteor - pathFor returning empty href -
i've done quite bit of searching , testing on feel should pretty straightforward, since working on other routes:
<a href="{{ pathfor 'categorylist' }}">{{post.category}}</a>
here iron router route:
router.route("/category/:category", function() { this.render("categorylist", { waiton: function() { return meteor.subscribe("posts"); }, data: function() { session.set("categoryname", this.params.category); return { posts: posts.find({category: this.params.category}) } } }); }, { name: 'categorylist' });
when load post html / spacebars, href empty. i've tried declaring name route, , comes empty. missing obvious?
thanks, paul
you need include parameter route in pathfor.
<a href="{{ pathfor 'categorylist' category=post.category}}">{{post.category}}</a>
Comments
Post a Comment