Forum: Ruby on Rails derirect web page to file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Darkwax (Guest)
on 2006-06-13 04:49
Hi all, quick question to all of you ruby on rails experts. I need to
redirect the output of a url to an actual physical file. In other words,
I need to have what I see in the web browser to intead be written into a
file. Any ideas? Thank you.

Darkwax
880f96b24ef64881d9ee2e9f062d59a8?d=identicon&s=25 Glenn C. (glenn)
on 2006-06-13 05:36
Darkwax wrote:
> Hi all, quick question to all of you ruby on rails experts. I need to
> redirect the output of a url to an actual physical file. In other words,
> I need to have what I see in the web browser to intead be written into a
> file. Any ideas? Thank you.
>
> Darkwax

Step 1.

You mean the output of a foriegn url? or the output of some kind of
template? If the latter then render the template to a string in the
controller, eg this could be used to render some kind of invoice.

text = render_to_string ( :action => :invoice_doc_view )

Step 2.

Now the question is do you mean the "text" string is then saved to the
rails server filesystem or do you want it to be saved to the
users/clients filesystem?
This topic is locked and can not be replied to.