`@photos.limit(3).each do |photo|` - no need for another instance or even local variable, never create them in a view anyway. Also avoid `for` in Ruby unless you're sure you want its scoping behavior (which is unexpected if you're coming from other languages).