Forum: Ruby on Rails Can I send rendered .html to somewhere besides the web serve

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.
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-05-18 16:59
(Received via mailing list)
Is there any way to tell Rails to send the .html file it renders
somewhere other than the web server?  I need to save a page to the
server's file system instead of sending it to the user's browser.

Thanks!
Bill
119af50160cabfe1fb6f2f05f5018c64?d=identicon&s=25 James Ludlow (Guest)
on 2006-05-18 17:13
(Received via mailing list)
On 5/18/06, Bill Walton <bill.walton@charter.net> wrote:
> Is there any way to tell Rails to send the .html file it renders somewhere
> other than the web server?  I need to save a page to the server's file
> system instead of sending it to the user's browser.

http://api.rubyonrails.org/

Look up "render_to_string"
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-05-18 17:37
(Received via mailing list)
Thanks, James.  I'll check it out!

Best regards,
Bill
----- Original Message -----
From: "James Ludlow" <jamesludlow@gmail.com>
To: <rails@lists.rubyonrails.org>
Sent: Thursday, May 18, 2006 10:12 AM
Subject: Re: [Rails] Can I send rendered .html to somewhere besides the
webserver?


On 5/18/06, Bill Walton <bill.walton@charter.net> wrote:
> Is there any way to tell Rails to send the .html file it renders somewhere
> other than the web server?  I need to save a page to the server's file
> system instead of sending it to the user's browser.

http://api.rubyonrails.org/

Look up "render_to_string"
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
5e518814b76962fdd1ad0e74dfac5ea7?d=identicon&s=25 Martin Gamsjaeger (Guest)
on 2006-05-18 19:21
(Received via mailing list)
Hi Bill,

This is from a recent post to this list:

@render = render :action => controller.action_name
outf = File.open(Time.now + ".html","w")
outf.puts @render
outf.close

I guess after that you can do whatever you want with outf ..

cheers
Martin
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-05-18 22:36
(Received via mailing list)
Hi Martin,

Thanks!  I appreciate it very much.

Best regards,
Bill

----- Original Message -----
From: "Martin Gamsjaeger" <gamsnjaga@gmail.com>
To: <rails@lists.rubyonrails.org>
Sent: Thursday, May 18, 2006 12:20 PM
Subject: Re: [Rails] Can I send rendered .html to somewhere besides
thewebserver?


>
>> To: <rails@lists.rubyonrails.org>
>>
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>


--------------------------------------------------------------------------------
This topic is locked and can not be replied to.