好傢伙,我有這個在我的constroller不能轉換成零陣will_paginate我有在軌道3 will_paginate問題
@posts = Post.paginate(:all,
:include => [:author, :categories],
:conditions=>"status = 'published'",
:order=>"blog_posts.created_at DESC",
:per_page => 1, :page => params[:page])
和<%= will_paginate @posts%>在我看來,但我得到這個錯誤不能將nil不斷轉換成Array。
任何人都可以幫助我嗎?
在此先感謝
Iain非常感謝!這解決了這個問題 – Michael 2010-12-12 20:54:31
如果你有1000個帖子,這將加載他們全部,數組分頁。效率不高。 – 2011-02-09 21:37:34
它不應該;它仍然是一個集合,因此它應該在查詢執行前將範圍添加到查詢中。 – iain 2011-02-09 23:13:15