You're going to need to strip off everything except the content of the Body tag, and you're going to need to police what is inside the body for illegal constructs that could blow up the rest of your page. That means maybe something like Nokogiri to parse the HTML into an internal DOM tree, then print the body tag back out as a stream.

I would say your best bet is to simply generate a partial that holds an iframe, targeted to the MSWord "html" file. That will at least sandbox that code and keep it from wreaking havoc with your layout.

Walter

On Nov 22, 2010, at 7:17 AM, Ralph Shnelvar wrote:

Let's say that I have an MS Word document saved as an HTML document.

I want to present this document as a div; that is, make the MS HTML
sort of a partial.

Is there a RoR facility to do so?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to