Excuse me I have a problem with will_paginate plugin.
In localho开发者_如何学Pythonst, in my controller, I use person.operations.descend_by_date.paginate :page => params[:page] || 1
. However in production the method show error. I think that the problem is thye parameter page. Because person.operation.descend_by_date return a collection i try passing only params[:page] || 1
.
However in localhost show error. The rare subject is:
If I evaluate the method once => Show error IF i evaluate the method twice or more times => works ok
Rails show this message error: hash parameters expected
Why could be the error?
First i convert the will_paginate object to array and then i use the method for arrays of will_paginate
person.operations.descend_by_date.to_a.paginate params[:page] || 1
Thanks
精彩评论