I have a rails app that receives email and displays their bodies on a
single web page. My problem is that some of the emails are plain text
and others are HTML. The bodies of the HTML emails are displayed in
their textareas with all of the embedded HTML markup visible.
I’d like to render the bodies before I display each in its textarea, or
strip the markup out and simply dispay the content. I think
render_to_string() might do the trick, but it’s a Controller method and
I think I need it in either the ActionMailer when I’m reading the email
or in the View when I’m displaying the email.
Is there an existing way to render the HTML or strip out the markup when
I am importing the email or when I am displaying the email bodies?