インデックス ページにリストされている予定をページ分割したいのですが、ページ分割メッセージをどこに配置すればよいかわかりません。コントローラーにインデックス メソッドを実装する方法は次のとおりです。
def index
if !current_user.nil?
filter = []
@my_apps = Appointment.joins(:client).where("user_id = ?", current_user.id)
if !params[:paid].blank?
paid = params[:paid]
filter << ["copay_received = '#{paid.to_s}'"]
end
if !params[:effective_on].blank?
junk = params[:effective_on]
filter << ["clients.effective_on >= '#{junk.to_s}'"]
end
@unpaids = @my_apps.where(filter.join(" AND "))
else
redirect_to '/signin'
end
end
end
where句の後とwhere句の後に.paginate(page: params[:page])
、オブジェクトに追加しようとしましたが、うまくいきませんでした。Appointment
@my_apps
私が間違っていることを教えてください。