fix article pagination

This commit is contained in:
JuliusR 2021-12-18 15:43:10 +01:00
parent 952aecfb40
commit 81ba5ab20e

View file

@ -15,11 +15,11 @@ class ArticlesController < ApplicationController
elsif params[:order] elsif params[:order]
case params[:order] case params[:order]
when 'updated_on' when 'updated_on'
@articles = @supplier.articles.paginate :all, :order => "updated_on DESC", :page => params[:page] @articles = @supplier.articles.all.page(params[:page]).order(updated_on: :desc)
@updated_on = true @updated_on = true
end end
else else
@articles = @supplier.articles.paginate :page => params[:page] @articles = @supplier.articles.page(params[:page])
end end
respond_to do |format| respond_to do |format|