title: Handlebars / Mustache with Rails url_for
body: <p>I'm trying to use a named route with <code>{{id}}</code> as one of the params, allowing the rendered content to be consumed by Handlebars. <code>url_for</code> is escaping the param so the resulting url contains <code>%7B%7Bid%7D%7D</code>. I've tried adding <code>:escape =&gt; false</code> to the call, but it has no effect. </p>
  
  <h3>routes.rb</h3>
  
  <pre><code>resources :rants, :except =&gt; [:show] do
    post '/votes/:vote', :controller =&gt; 'votes', :action =&gt; 'create', :as =&gt; 'vote'
  end
  </code></pre>
  
  <h3>index.haml</h3>
  
  <pre><code>%script{:id =&gt; 'vote_template', :type =&gt; 'text/x-handlebars-template'}
    .votes
      = link_to 'up', rant_vote_path(:rant_id =&gt; '{{id}}', :vote =&gt; 'up')
      %span {{votes}}
      = link_to 'down', rant_vote_path(:rant_id =&gt; '{{id}}', :vote =&gt; 'down')
  </code></pre>
  
  <h3>application.js</h3>
  
  <pre><code>var vote_template =  Handlebars.compile($('#vote_template').html());
  </code></pre>
  
  <h3>output</h3>
  
  <pre><code>&lt;script id="vote_template" type="text/x-handlebars-template"&gt;
    &lt;div class='votes'&gt;
      &lt;a href="/rants/%7B%7Bid%7D%7D/votes/up"&gt;up&lt;/a&gt;
      &lt;span&gt;{{votes}}&lt;/span&gt;
      &lt;a href="/rants/%7B%7Bid%7D%7D/votes/down"&gt;down&lt;/a&gt;
    &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I've simplified the example for the sake of readability but question remains the same; is there any way to use a named route with <code>{{ }}</code> as a param? I understand I can just do <code>link_to 'up', '/rants/{{id}}/votes/up'</code> so please don't supply that as an answer.</p>