Chris
2006-Aug-17 13:07 UTC
[Rails] How to save output "render :action=>:any_action" to a file?
I need to save the output of my rails app to a file. i.e. instead of rendering a page when using "render :action=>:any_action" i want the output to be saved to a file. Anyone got any ideas? Thanks Chris -- Posted via http://www.ruby-forum.com/.
Romeu Henrique Capparelli Fonseca
2006-Aug-17 13:11 UTC
RES: [Rails] How to save output "render :action=>:any_action" to a file?
Hi, Use render_to_string (ActionController::Base) and write string to file Att., Romeu -----Mensagem original----- De: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] Em nome de Chris Enviada em: quinta-feira, 17 de agosto de 2006 09:08 Para: rails@lists.rubyonrails.org Assunto: [Rails] How to save output "render :action=>:any_action" to a file? I need to save the output of my rails app to a file. i.e. instead of rendering a page when using "render :action=>:any_action" i want the output to be saved to a file. Anyone got any ideas? Thanks Chris -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.1/421 - Release Date: 16/8/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.1/421 - Release Date: 16/8/2006
Jason Roelofs
2006-Aug-17 13:13 UTC
[Rails] How to save output "render :action=>:any_action" to a file?
render_to_string will do what you want. It returns a string of the rendered text, letting you do what you want with it. Jason On 8/17/06, Chris <evilgeenius@gmail.com> wrote:> > I need to save the output of my rails app to a file. i.e. instead of > rendering a page when using "render :action=>:any_action" i want the > output to be saved to a file. > > Anyone got any ideas? > > Thanks > Chris > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/9be9e7c5/attachment.html