title: How to return "text/html" content for AJAX call using a template engine in sinatra?
body: <p>SO, I have a problem with Ajax (using JQuery) and Sinatra.</p>
  
  <p>I have a route:</p>
  
  <pre><code>get '/ajx' do
    content_type 'text/html', :charset =&gt; 'utf-8'
    slim :mypartitial, :layout =&gt; false
  end
  </code></pre>
  
  <p>which is to be called via Ajax "GET":</p>
  
  <pre><code>  $(document).ready(function() {
      $('#vars').click(function(event){
        $.ajax({  
          type: "GET",  
          url: "/ajx",  
          data: "",
          success: function(data) {  
            $("#result").html(data)
          }  
        }); 
      });
    });
  </code></pre>
  
  <p>But I get no html output and nothing is rendered. I suppose the problem is here</p>
  
  <pre><code> slim :mypartitial, :layout =&gt; false
  </code></pre>
  
  <p>but I have no idea how to return a valid html still using the template engine.</p>