From: Jacob Fugal Date: 2006-09-14T11:32:26+09:00 Subject: Re: eRB <%= On 9/13/06, Ezra Zygmuntowicz wrote: > On Sep 13, 2006, at 6:05 PM, Rob Sanheim wrote: > > One thing I've often wondered is how do you output from w/i a "non > > output" block...ie in java scriptlets these are equivalent: > > > > <% out.println("hi") %> > > <%= "hi" %> > > > > With ERB I've had some (admittedly rare) cases where this would be > > useful. Is it possible? > > <% _erbout << "hi" %> > > Its ugly but it works. You can of course also wrap it in a helper[1] method of your own as well, to get rid of the ugly. For example: def echo(value) _erbout << value.to_s end then later in your template: <% echo "Hi!" %> Jacob Fugal [1] If you take "helper" there literally in the rails sense, you probably want it in your application_helper.rb file; the same can apply for any ERB usage using "helper" in a more general sense, however.