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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Davis wrote in post #963121:> > 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. > > WalterThank you, Walter. Until you mentioned it, I didn''t even know that iFrames existed. Using an iFrame was relatively easy. Thank you! Ralph -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- [RFC] migrating LLVM to C++14
- Control statements with condition with greater than one should give error (not just warning) [PATCH]
- Control statements with condition with greater than one should give error (not just warning) [PATCH]
- Rails, .swf, .flv
- Facebooker support for iframe apps