title: rails 3 - How to render a PARTIAL as a Json response
body: <p>I want to do something like this:</p>
  
  <pre><code>class AttachmentsController &lt; ApplicationController
    def upload
      render :json =&gt; { :attachmentPartial =&gt; render :partial =&gt; 'messages/attachment', :locals =&gt; { :message=&gt; @message} }
    end
  </code></pre>
  
  <p>Is there a way to do this? render a Partial inside a JSON object? thanks</p>