title: Rails Rendering a partial within JSON
body: <p>I am trying to render a partial inside a JSON file so that I can use it via AJAX. Currently in my JSON file I have:</p>
  
  <pre><code>&lt;% self.formats = ["html"]%&gt;
  {
     "html": "&lt;%= raw escape_javascript(render(:partial =&gt; 'shared/mini_posts', :locals =&gt; {:type =&gt; "left"}).to_json )%&gt;"
  }
  </code></pre>
  
  <p>This currently returns no response, but my logs show that shared/mini_posts was rendered.</p>
  
  <p>Note that if I try something like:</p>
  
  <pre><code>{
     "html" : "test"
  }
  </code></pre>
  
  <p>This returns correctly.</p>
  
  <p>My jQuery looks like:</p>
  
  <pre><code>$j.ajax({
      url('/thepage.json'),
      dataType: 'json',
      success: function(data){
          console.log(data);
      }
  })
  </code></pre>