From: David Heinemeier Hansson Date: 2004-03-26T22:55:01+09:00 Subject: Re: newbie erb question >> ....code template in plain text... >> <% code_lines.each { |line| print line } %> >> ....more plain text code... > > Try this: > > <% code_lines.each do |line| %> > <%= line %> > <% end %> Alternatively, you can do: <%= code_lines.join %> Or, if your example was simplified and you really need to do something with each line, then for example: <%= code_lines.collect { |line| line.capitalize }.join %> But it's not as logical as could be. Wouldn't it be possible to point STDOUT somewhere else and insert it correctly? Perhaps ERb/eRuby already allows for this and we just don't know :). -- David Heinemeier Hansson, http://rails.nextangle.com/ -- Rails: Web-applications in Ruby http://www.basecamphq.com/ -- Web-based Project Management http://www.loudthinking.com/ -- Broadcasting Brain