We ran into a similar problem, we solved it by using the paginated_collection
method,
Something like below might work (this code is not tested!),
paginated_collection Video.where(visibility: false).page(params[:page]).per(10) do
collection.each do |video|
tr do
td { video.name }
td { video.uploader_name }
td { video.uploader_email }
td { link_to video.link, video.link, target: '_blank' }
td { truncate(video.description, omision: "...", length: 100) }
td { button_to("Accept", accept_path(video)) }
td { button_to("Reject", decline_path(video), method: :delete, :data => { :confirm => 'Are you sure, you want to reject the video?' })}
end
end
end
Hope this helps!