Use the Kaminari pagination plugin