第一个代码:
# matches/index.html.haml
%ul.match_list
- @matches.each do |match|
%li
=render match
# matches/_match.html.haml
%li
=match.id
Completed 200 OK in 665ms (Views: 496.3ms | ActiveRecord: 142.1ms)
慢得要命。
第二个代码:
# matches/index.html.haml
%ul.match_list
- @matches.each do |match|
%li
=match.id
Completed 200 OK in 196ms (Views: 30.0ms | ActiveRecord: 134.6ms)
好多了。
为什么不使用部分时它会快得多?