title: meteor iron router dynamic segment not working
body: <p>I've been looking into meteor and it's awesome! I've been looking for routing solutions and I found 'iron-router' which is cool, I managed to get the get static pages working with templates but when I go to /posts/123, the page does not render. I have been following a video on this site</p>
  
  <p><a href="https://www.eventedmind.com/feed/q8QWX5e7PTu8BEReY" rel="nofollow">https://www.eventedmind.com/feed/q8QWX5e7PTu8BEReY</a></p>
  
  <p>Here's my code</p>
  
  <p>blog.js EDITED</p>
  
  <pre><code>Posts = new Meteor.Collection('posts');
  
  Router.configure({
    layout: 'layout',
    loadingTemplate: 'loading',
    notFoundtemplate: 'notFound'
  });
  
  Router.map( function (){
    this.route('posts', {
      path: '/',
      waitOn: function () {
        return App.subs.posts;
      },
      data: {
        posts: function () {
          return Posts.find({}, {sort: {order: 1}});
        }
      }
    });
  
    this.route('postShow', {
      path: '/posts/:_id'
    });
  });
  
  if (Meteor.isServer) {
    Meteor.publish('posts', function () {
      return Posts.find({}, {sort: {order: 1}});
    });
  
    Meteor.publish('post', function (id) {
      return Posts.find({_id: id});
    });
  }
  
  if (Meteor.isClient) {
    App = {
      subs: {
        posts: Meteor.subscribe('posts')
      }
    };
  
    PostShowController = RouteController.extend({
      template: 'postShow',
      before: function () {
        var _id = this.params._id;
  
        if(App.subs.post)
          App.subs.post.stop();
  
        App.subs.post = Meteor.subscribe('post', _id);
      },
      data: {
        body: function () {
          return Posts.findOne({_id: this.params._id});
        }
      },
      run: function () {
        this.render('postShow');
      }
    });
  }
  </code></pre>
  
  <p>blog.html</p>
  
  <pre><code>&lt;head&gt;
      &lt;title&gt;IronRouter&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;/body&gt;
  
  &lt;template name="layout"&gt;
      &lt;div class="container"&gt;
          &lt;aside class="sidebar"&gt;
              &lt;div class="sidebar-inner"&gt;
                  {{yield 'sidebar'}}
              &lt;/div&gt;
          &lt;/aside&gt;
  
          &lt;section class="content"&gt;
              &lt;div class="content-inner"&gt;
                  {{yield}}
              &lt;/div&gt;
          &lt;/section&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;template name="notFound"&gt;
    &lt;h1&gt;Not Found&lt;/h1&gt;
  &lt;/template&gt;
  
  &lt;template name="loading"&gt;
    &lt;h1&gt;Loading...&lt;/h1&gt;
  &lt;/template&gt;
  
  &lt;template name="posts"&gt;
    &lt;h1&gt;Posts&lt;/h1&gt;
    &lt;ul&gt;
      {{#each posts}}
      &lt;li&gt;{{&gt; postListItem}}&lt;/li&gt;
      {{/each}}
    &lt;/ul&gt;
  &lt;/template&gt;
  
  &lt;template name="postListItem"&gt;
      &lt;a href="{{pathFor 'postShow'}}"&gt;
          {{title}}
      &lt;/a&gt;
  &lt;/template&gt;
  
  &lt;template name="postShow"&gt;
    &lt;p&gt;
      {{body}}
    &lt;/p&gt;
  &lt;/template&gt;
  
  &lt;template name="postShowSidebar"&gt;
    &lt;h1&gt;{{title}}&lt;/h1&gt;
  &lt;/template&gt;
  </code></pre>