[Rails] PHP ob_start in Ruby

eduard
2006-01-20T19:32:22Z

Thanks Tom, it works great!


On 1/19/06, Tom Fakes <tom@craz8.com> wrote:
>
>  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
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...