Resources

Summary

# Gemfile
gem 'kaminari'

# Terminal
# Generate the kaminari config
rails g kaminari:config

# Generate kaminari views
rails g kaminari:views bootstrap3

# users_controller.rb
  def index
    @users = User.order(:last_name).page(params[:page])
  end

# index.html.erb
<%= paginate @users %>

# user.rb
class User < ApplicationRecord
  paginates_per 5
end