From: Patrick Gundlach Date: 2006-01-03T22:52:57+09:00 Subject: Re: could someone explain this CGI problem ? > the following code sequence > > cgi.div{ > 1..3.times{ |i| > cgi.div{ > "hello from div" > } > } > } > > produces > >
> 1..3 >
This is, because the 1..3..... statement returns "1..3" and this is what cgi gets. Try it with irb. perhaps this works (untested) > cgi.div{ temp_string="" > 1..3.times{ |i| temp_string << cgi.div{ "hello from div" } > } temp_string > } i.e. it collects the divs in a temporary string and gives that to the outer div. Patrick