title: Custom Conditionals in Handlebars
body: <p>May be missing something simple, but how can I specify a conditional in Handlebars based on an operation on the object?</p>
  
  <p>Looking to do something like</p>
  
  <pre><code>{{#hasDiscount this}}
    &lt;tr&gt;
      &lt;td&gt;Discount&lt;/td&gt;
      &lt;td&gt;{{formatPrice this.Discount}}&lt;/td&gt;
    &lt;/tr&gt;
  {{/hasDiscount}}
  </code></pre>
  
  <p>With the helper along the lines of</p>
  
  <pre><code>Handlebars.registerHelper 'hasDiscount', (cart) -&gt;
    :runBlock: if cart.Discount &gt; 0
  </code></pre>
  
  <p>Not sure how to tell it to run the block.</p>
  
  <p>Thanks for any input.</p>