title: How to evaluate variables on handlebars helpers
body: <p>I'm trying to build a helper to resolve ulr routes, like this:</p>
  
  <pre><code>Handlebars.registerHelper('rails_route', function(route, options) {
    var fn = Routes[route];
    if(typeof fn === 'function') {
       var opts = {};
       for (var key in options.hash) {
          var value = options.hash[key];
          opts[key] = options.fn(value); // Uncaught TypeError: Object #&lt;Object&gt; has no method 'fn' 
        }
        return fn(opts);
    }
    return "#";
  });
  </code></pre>
  
  <p>And i call this helper like this:</p>
  
  <pre><code>&lt;ul class="dropdown-menu"&gt;
    {{#each membership in controllers.currentUser.user.memberships}}
    &lt;li&gt;
      &lt;a href="{{rails_route root_path firm_id=membership.firm.id }}"&gt;{{membership.firm.name}}&lt;/a&gt;
    &lt;/li&gt;
   {{/each}}
  &lt;/ul&gt;
  </code></pre>
  
  <p>I need to evaluate "membership.firm.id" but i alaways get "Uncaught TypeError: Object # has no method 'fn' ". What is the right way to do this?</p>