From: Rein Henrichs Date: 2010-06-13T16:40:12+09:00 Subject: Re: How to print something with erb? On 2010-06-12 06:52:12 -0700, Dominic Rose said: > Rein Henrichs wrote: >> On 2010-06-10 07:59:42 -0700, Dominic Rose said: >> >>> >>> puts or print comes before any text.. Do you wich function instead of >>> puts would print test{123}? >>> >>> Thanks wery much >> >> Do not combine puts with <%= %> output in your erb templates. puts >> prints to STDOUT, which may or may not be where your erb template is >> rendered. Just use <%= %>. > > 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 > > Except that I don't know what is the erbout real identifier. Just use <%= %>. -- Rein Henrichs http://puppetlabs.com http://reinh.com