About <Discover Meteor>:how to pass parameter to "pathFor"?


#1

I added an attribute “category” to each post:

I want to achieve:click on the different menus, show the corresponding posts.The code is shown below:

    <li><a>Posts</a>
          <ul>
           <li><a href="{{pathFor 'postsList' category='Image'}}">Image</a></li>
           <li><a href="{{pathFor 'postsList' category='Video'}}">Video</a></li>
          </ul>
  </li>
 Router.route('postsList',
       {path:'/postsList/:category',
        data: function() { return Posts.find(this.params.category); }
       });

But there is no effect!