Try doing it after you set @my_apps
.
For instance...
@my_apps = Appointment.joins(:client).where("user_id = ?", current_user.id)
@my_apps = @my_apps.paginate(page: params[:page])
I ran into the same problem as you, but this fixed my issue with pagination.