On Feb 10, 2009, at 01:11 , Zhenning Guan wrote:

> topics.each do |f|
>  times +=1
>  puts f.title
>  if times > 4
>    break

there are a lot of ways. My first reaction is:

   topics.first(5).each do |f|
     puts f.title
   end

If you define to_s on the topic class to return title then you can do:

   puts topics.first(5)

and be done with it.