I am trying to show a rail view file in a text box. The view file contains a bunch of HTML that I want to escape so that it doesn't interfere with the html page. here is an example:
In this view we are going to display the contents of a partial
<textarea>
<%= html_escape render('partial') %>
</textarea>
and in partial.html.erb I will have
Hello this is partial.html.erb and this is a
<textarea>textarea</textarea> blah blah blah.
The problem is that textarea in partial.html splits the text field in the first view, because it is not html_escaped. How do I display a property and display the contents of a part inside a text box?
source
share