title: Change Body Class Based On URL in Meteor
body: <p>I have a template named <strong>layout</strong> in my app. Inside has:</p>
  
  <pre><code>&lt;body id="body class="{{blue}}&gt;
  </code></pre>
  
  <p>Basically what I want to achieve is that when you hit a url, for example, www.abc.com/sky, I want to add a body class of blue:</p>
  
  <pre><code>&lt;body id="body class="blue"&gt;
  </code></pre>
  
  <p>In my <strong>client</strong> folder I have this but seems not to work:</p>
  
  <pre><code>Template.layout.helpers({
    blue: function() {
      var loc = window.location.href; // returns the full URL
      if(/sky/.test(loc)) {
      $('#body').addClass('blue');
      }
    }
  });
  </code></pre>
  
  <p>I am new to the javascript world and I am following a tutorial but the tutorial was not aimed for Meteor.</p>