title: Meteor/Iron router: how to wait on data which depends on other data
body: <p>I have a situation which is best described using the following code:</p>
  
  <pre><code>Meteor.publish('users', function (name) {
    return Users.find({name: name});
  });
  
  
  Meteor.publish('posts', function (userId) {
    return Posts.find({userId: userId}, {sort: {insertDate: 1}});
  });
  </code></pre>
  
  <p>A user has many posts. So, when the url is</p>
  
  <pre><code>http://example.com/john
  </code></pre>
  
  <p>So, to find the posts for a specific user I need to know the id of the user.</p>
  
  <p>Now I have the following Controller:</p>
  
  <pre><code>UserController = RouteController.extend({
      onBeforeAction: function () {},
      waitOn: function () {
          var userSub = Meteor.subscribe('user', this.params.name);
          return [userSub]; 
      },
      data: function () { ... },
      action: function () {
          if (this.ready()) {
              this.render('user');
          }
          else {
             ;//this.render('loading');
          }
      }
  });
  </code></pre>
  
  <p>Now I can only <code>waitOn</code> the user, but I also want to waitOn the Posts, but how can I do this, because to subscribe to the posts I need to know the userId:</p>
  
  <pre><code>Meteor.subscribe('posts', user._id);
  </code></pre>
  
  <p>Any suggestions ?</p>