Bill Walton
2006-May-18 14:59 UTC
[Rails] Can I send rendered .html to somewhere besides the web server?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/facce47e/attachment.html
James Ludlow
2006-May-18 15:12 UTC
[Rails] Can I send rendered .html to somewhere besides the web server?
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"
Bill Walton
2006-May-18 15:36 UTC
[Rails] Can I send rendered .html to somewhere besides the webserver?
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
Martin Gamsjaeger
2006-May-18 17:20 UTC
[Rails] Can I send rendered .html to somewhere besides the webserver?
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 On 5/18/06, Bill Walton <bill.walton@charter.net> wrote:> 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 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Bill Walton
2006-May-18 20:33 UTC
[Rails] Can I send rendered .html to somewhere besides thewebserver?
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?> 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 > > On 5/18/06, Bill Walton <bill.walton@charter.net> wrote: >> 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 >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >--------------------------------------------------------------------------------> _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >