Suppose we have an object which is having value as array of hashes (In example @student['
so the is given below
@students = WillPaginate::Collection.
# inject the result array into the paginated collection:
pager.replace(@student['
unless pager.total_entries
# the pager didn't manage to guess the total count, do it manually
pager.total_entries = (@student['total_pages'] * @page_size)
end
end
No comments:
Post a Comment