From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-06-07T04:46:51+09:00 Subject: Re: RUBY, CGI and objectts On Fri, 06 Jun 2003 22:13:30 +0200, Simon Strandgaard wrote: > > Sorry I was too quick... you need to do "collect & join", like this: > > @cgi.tr { row.collect { |cell| @cgi.td {"#{cell}"} }.join } > If you think that "collect & join" is anoying.. then try this: class Array # block-join def bjoin(sep=$,) return join(sep) if not block_given? collect { |y| yield(y) }.join(sep) end end #puts [1, 2, 3].bjoin #puts [1, 2, 3].bjoin("-") #puts [1, 2, 3].bjoin { |v| "