Posted by
hjuskewycz
on
July 29, 2010
In Rails 3, render :collection is much faster than looping over a collection and calling render :partial manually. Some initial benchmarking showed up to 3 times faster rendering when render :collection was used.
Thanks to Yehuda for this protip (sended via Twitter)

Comments
1. You are really going to re-use the inside of the loop elsewhere OR
2. If the inside of the loop is really complicated and putting it inside of the loop would make the code hard to read.
But if you are simply printing a row of a table why not just inline it. Fast and easy to understand.