# Re: capture eruby

**URL:** <https://www.ruby-forum.com/t/re-capture-eruby/69117>\
**Category:** Ruby\
**Created:** [September 18, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/re-capture-eruby/69117 "2006-09-18T20:20:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [September 18, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/re-capture-eruby/69117/1 "2006-09-18T20:20:43Z")

</div>

From: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of dc

> is there a way to capture the output of eruby?  
> i want a templating parser, but not to the screen, just for  
> my own capture.

Use ERB - it’s the pure ruby implementation, and returns string values,  
which you can choose to send to stdout, a file, etc.

> i understand helperclass methods are not available in controllers.  
> where is the recommended ROR place for putting your own classes?

I’m not sure if it’s the ‘recommended’ place, but I personally put my  
own ruby library file in /lib/basiclib.rb, and put “require ‘basiclib’”  
at the bottom of config/environment.rb. Seems to work nicely.
