I’m using the will_paginate gem. The default is 30 elements per page. How do I customize this?
I’m using the will_paginate gem. The default is 30 elements per page. How do
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your controller is called User, you can do something like this in your controller:
@users = User.paginate :page => params[:page], :per_page => 10, :order => 'name ASC'This will show 10 results per page.In your view:
<%= will_paginate @users %>