我想知道是否有人可以解释如何在一个对象数组上使用will_paginate?
例如,在我的网站上,我有一个意见部分,用户可以对意见进行评分.这是我写的一个方法来收集评价意见的用户:
def agree_list
list = OpinionRating.find_all_by_opinion_id(params[:id])
@agree_list = []
list.each do |r|
user = Profile.find(r.profile_id)
@agree_list << user
end
end
Run Code Online (Sandbox Code Playgroud)
谢谢