2010-11-07 49 views
2

如何在Ruby on Rails 3中「刷新」輸出?Rails 3輸出沖洗

在PHP中我會做類似如下:

$i = 0; 
$total = count($result); 
foreach ($result as $item) { 
    $i++; 
    time_consuming_action($item); 
    echo "Finished $i of $total<br>"; 
    flush(); 
} 

回答