undefined method ‘paginate’ for Array (will_paginate 3.0)

If you ever find this problem (Github Issue) you should know that WillPaginate 3.0 isn’t backwards compatible.

This also is tightly coupled with the new Active Record implementation (Now it returns ActiveRecord::Relation, which are lazy arrays)

This solved the problem I was having:

1
2
  # 调用的controller目录
  require 'will_paginate/array'
 

Be careful when you upgrade your will_paginate gem.

from:http://www.etagwerker.com/2011/09/liquid-error-undefined-method-paginate-for-array-will-paginate-3-0/

猜你喜欢

转载自pvpful.iteye.com/blog/1179132