From: Julian Leviston Date: 2009-02-10T21:17:28+09:00 Subject: Re: a better way to do this job? Your code also won't work. Your tempvar is not declared and you have no end to the block. topics[0..3].each do |topic| puts topic end Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 10/02/2009, at 8:11 PM, Zhenning Guan wrote: > topics.each do |f| > times +=1 > puts f.title > if times > 4 > break > > > a little ugly, doesn't it? > -- > Posted via http://www.ruby-forum.com/. >