title: Meteor: Router with URL of a userName?
body: <p>I have problems with creating routes with user's usernames. So idea is something like this: Click on path and go to that users profile. His link should be something like : <a href="http://www.something.com/usersUsername" rel="nofollow noreferrer">http://www.something.com/usersUsername</a>
  I was reading and trying everything I found on internet about this but lot of stuff changed so I couldn't manage this.
  Only thing I found usefull is that when page loads client ,,watch&quot; paths first and then subscribes to a collection so I got ,,null&quot; for path. Any help? My idea is to create something to waitOn for subscribe...</p>
  <p><em>Packages</em>: <strong>iron:router</strong> , <strong>accounts-ui</strong> , <strong>accounts-password</strong></p>
  <p>Here is code:</p>
  <p><strong>Start page, template:</strong></p>
  <pre><code>&lt;template name=&quot;početna&quot;&gt;
  &lt;h1&gt;Dobrodošli!&lt;/h1&gt;
  &lt;h3&gt;Registrujte se:&lt;/h3&gt;
      {{&gt; register}}
  &lt;h3&gt;Prijavite se:&lt;/h3&gt;
      {{&gt; login}}
  
  {{#if currentUser}}
      &lt;h2&gt;Logovan si!&lt;/h2&gt;
      {{&gt; logout}}
      &lt;a href=&quot;{{pathFor route='profil' username=username }}&quot;&gt;Profil&lt;/a&gt;
  {{/if}}
  </code></pre>
  
  <p><strong>Router JS file:</strong></p>
  <pre><code>    Router.configure({
      layoutTemplate: 'okvir'
  });
  
  // *  * * * *  * //
  
  Router.route('/', {
      name: 'početna', 
      template: 'početna',
  });
  
  Router.route('/:username',  {
     waitOn: function(){
         return Meteor.subscribe('userData'), Meteor.user().username
            },    
      name: 'profil',
      template: 'profil',
      
  });
  </code></pre>
  <p><strong>Simple HTML template file only to se if it works:</strong></p>
  <pre><code>&lt;template name=&quot;profil&quot;&gt;    
      &lt;h1&gt;RADI&lt;/h1&gt;
  &lt;/template&gt;
  </code></pre>
  <p><strong>Thanks!</strong></p>