Rails: Showing 10 or 20 or 50 results per page with will_paginate how to?

前端 未结 3 828
我在风中等你
我在风中等你 2021-02-06 14:58

me again...

I need show 10 or 20 or 50 results number of results per page with a select options in my list of posts using will_paginate plugin

Can you help me p

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-06 15:32

    Here is what I will do

    Class UsersController < ApplicationController
        def index
            @users = User.paginate(:all, :page => params[:page], :per_page => params[:number_of_records])
        end
    end
    

提交回复
热议问题