Re: Rendering of Remote Partials

Jason Roelofs
Thu, 10 May 2007 22:23:24 -0000

On 5/10/07, doug <ddjolley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
>
> > iframes are your best bet for that.
> >
> > <iframe
src="http://path.to.external/htmlfile">
> >
> > Jason
>
> I hate to keep hammering on this; but, I am hopeful that if I persist
> I''ll eventually be able to get across what I''m looking
for.  An iframe
> won''t meet my needs for 2 reasons:  (1) It places the content in a
> separate frame which can then be scrolled or whatever.  I don''t
want a
> separate frame.  I want to insert (include if you will) a  remote
> chunk of html code into the current document.  (2) iframes require a
> complete html document.  I want to include a chunk of html code which
> is not a complete html document into the current html document.  In
> short, I would like it to work just like a partial except that the
> source code for the partial is obtained from another server cross the
> network.
>
> Thanks for the input.
>
>          ... doug


Well, the only thing I can think of doing is building an HTTP request in
your controller action and dealing with the resulting HTML as you wish.
Assuming that by "source code of the partial" you mean it''s
still in Erb
form, then you''ll have to download the file from that remote server,
save it
in a retrievable place, which then makes it available as a regular partial.
Of course you can also use wget and treat the response as a string as well,
rendering it or running it through Erb as needed.

May I ask as to why you want to do this?

Jason