fix albums sort by rand

This commit is contained in:
JiangRu 2016-07-20 15:24:39 +08:00
parent 5f848cbffa
commit 958e801fc7
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,12 @@
class GalleriesController < ApplicationController
def index
albums = Album.filter_by_categories
# albums = Album.filter_by_categories
params = OrbitHelper.params
albums = Album.filter_by_categories([],false).filter_by_tags.sample(OrbitHelper.page_data_count)
albums = Kaminari.paginate_array(albums).page(params[:page]).per(OrbitHelper.page_data_count)
galleries = albums.collect do |a|
{
"album-name" => a.name,