On Wed, Jul 29, 2009 at 4:24 PM, Dan
Dunn<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Im pulling some emails off of a server, parsing them with TMail and
> looping through them in the view and displaying them. My problem is
> that I want to display the html emails I have but when I put them on the
> page the <html> and <body> tags of the email Im importing are
being
> injected into my sites html and body tags, which leads to some extremely
> weird results. If I escape the html via h @mail.body_html, I of course
> get a garbled mess. Any ideas on how to cut out these tags properly?
Use something like hpricot to (short version) get the innerHTML of
the BODY element of the email.
The doc/examples are pretty straightforward, but post back if you
have problems with it.
HTH,
--
Hassan Schroeder ------------------------
hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
twitter: @hassan