Can I send rendered .html to somewhere besides the web serve


#1

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


#2

On 5/18/06, Bill W. removed_email_address@domain.invalid 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”


#3

Thanks, James. I’ll check it out!

Best regards,
Bill
----- Original Message -----
From: “James L.” removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
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 W. removed_email_address@domain.invalid 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
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#4

Hi Martin,

Thanks! I appreciate it very much.

Best regards,
Bill

----- Original Message -----
From: “Martin G.” removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
Sent: Thursday, May 18, 2006 12:20 PM
Subject: Re: [Rails] Can I send rendered .html to somewhere besides
thewebserver?

To: removed_email_address@domain.invalid

removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



#5

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