On Jun 12, 7:52   鮮 
> If I want to print something on the middle of a script I should do
> "%><%= thing_to_print %><%" and that's what I was trying to avoid. Do
> you know if I can do somthing like that ?
>
> def print string
> $__erbout.write string
> end

Firstly:
As noted in the documentation, you can specify the erb out variable in
the call to ERB.new:
http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html#M000301
If you don't have control over that, you can look at the source and
see what (if any) name they are supplying and use that.


Secondly:
After I asked to have "puts" work almost 5 years ago, people on the
list
helped create a patch to ERB to allow print and puts to concatenate to
this string. See [1] below. This was followed by some discussion
(again prompted by me) for a RCR to allow this to work. See [2] below.
The discussion there is probably worth reading before we dive into
this again.

[1] http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/152709?152641-153992+split-mode-vertical

[2] http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/155537?155365-157410+split-mode-vertical