title: Rails How to escape and display the contents of a rendered view
body: <p>I am trying to show a rails view file in a textarea.  the view file contains a bunch of HTML, which I want to escape so that it does not interfere with on page html.  here is an example:</p>
  
  <pre><code>In this view we are going to display the contents of a partial
  &lt;textarea&gt;
  &lt;%= html_escape render('partial') %&gt;
  &lt;/textarea&gt;
  </code></pre>
  
  <p>and in partial.html.erb I would have</p>
  
  <pre><code>Hello this is partial.html.erb and this is a 
  &lt;textarea&gt;textarea&lt;/textarea&gt;  blah blah blah.
  </code></pre>
  
  <p>The problem is: the textarea in partial.html is breaking the textarea in the first view because it is not being html_escaped.  How do I property escape and display the contents of the partial inside the textarea?</p>