Skip to content
Discussion options

You must be logged in to vote

with will_paginate :

@records = #do your work and fetch array of records you want to paginate ( various types )
then do the following :

current_page = params[:page] || 1
per_page = 10
@records = WillPaginate::Collection.create(current_page, per_page, records.size) do |pager|
pager.replace(@records)
end
then in your view :

<%=will_paginate @records%>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bahriddin-abdusalomov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants