[Rails] PHP ob_start in Ruby

Tom Fakes
2006-01-19T21:43:21Z

In your Application Controller, add this:



after_filter { |controller|
        controller.response.headers[''Content-Length'']
controller.response.body.length

}



  _____

From: rails-bounces@lists.rubyonrails.org
[mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of eduard
Sent: Thursday, January 19, 2006 9:40 AM
To: Rails@lists.rubyonrails.org
Subject: [Rails] PHP ob_start in Ruby



I need to include Content-Length in each file.  In PHP it would be:

<?php
   ob_start();
?>

html

<?php
   header(''Content-Length: '' . ob_get_length());
ob_end_flush();
?>

How can I do the same in Ruby?

Thanks,
eduard

-------------- next part --------------
An HTML attachment was scrubbed...