Someone wrote in [community profile] rubyonrails 2013-05-26 07:57 pm (UTC)

KJAZZQFrPUpiPzBxzmM

只要將 Query 盡量善用 Rails 3 的 AREL 的架構去下, 就可以做到 lazy load. (就是 view 呼叫 each 之類的才會真的 query db).如此拉資料的邏輯還是在 Controller 裡. View 也可以一如往常再加 fragment cache. 如此就仍能保有一定的效率 (雖然還是在吃 cache 前產生了 AREL 的物件計算, 不過那應該影響非常小), 同時還能 keep the rule, 維持一致性的結構啦.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting