change order in admin page.
This commit is contained in:
parent
c2e3345228
commit
976f97f4db
|
@ -24,9 +24,9 @@ class Admin::WritingsController < OrbitMemberController
|
||||||
end
|
end
|
||||||
if params[:clear] != 'true'
|
if params[:clear] != 'true'
|
||||||
if(params[:new_filter] != nil && params[:new_filter][:type] == 'category')
|
if(params[:new_filter] != nil && params[:new_filter][:type] == 'category')
|
||||||
@writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc').page(params[:page]).per(10)
|
@writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10)
|
||||||
else
|
else
|
||||||
@writings = Writing.order_by(:year=>'desc').page(params[:page]).per(10)
|
@writings = Writing.order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_to admin_writings_url
|
redirect_to admin_writings_url
|
||||||
|
|
Loading…
Reference in New Issue