title: Routing in Meteor
body: <p>In Meteor I'm using Backbone in order to provide routing for the different pages in my app. I currently have a profile and an administration page. When I go to the profile page it shows up just as it should, however when I go to administration Meteor falls back to the main page.</p>
  
  <p>As a side-note, if anyone has a better pattern or best-practice for pages in Meteor feel free to share as this is quite cumbersome.</p>
  
  <p>I use the following template to decide what page to show:</p>
  
  <pre><code>&lt;template name="root"&gt;
      {{&gt; navbar}}
      {{#if pageIs "profile"}}
        {{&gt; profile}}
        {{else}}{{#if pageIs "administration"}}
          {{&gt; administration}}
        {{else}}
          {{&gt; main_page}}
        {{/if}}
      {{/if}}
  &lt;/template&gt;
  </code></pre>
  
  <p>The pageIs method is as follows:</p>
  
  <pre><code>Template.root.pageIs = function(page){
      console.log(Session.get('page'));
      return page === Session.get('page');
  }
  </code></pre>
  
  <p>And the following code in my Backbone router:</p>
  
  <pre><code>var ProtonRouter = Backbone.Router.extend({
      routes: {
          "profile": "profile",
          "admin": "administration",
          "administration":"administration"
      },
      profile: function () {
          Session.set('page','profile');
      },
      administration: function (){
          Session.set('page', 'administraion');
      },
      mainPage: function(){
          Session.set('page',null);
      }
  });
  </code></pre>
  
  <p>The log statement in the pageIs method will log undefined a couple of times and then log the correct page, even on administration, however Meteor doesn't seem to reload the selected page anyway and the template still hits the last else-statement.</p>