fix albums sort by rand
This commit is contained in:
parent
5f848cbffa
commit
958e801fc7
|
@ -1,6 +1,12 @@
|
||||||
class GalleriesController < ApplicationController
|
class GalleriesController < ApplicationController
|
||||||
def index
|
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|
|
galleries = albums.collect do |a|
|
||||||
{
|
{
|
||||||
"album-name" => a.name,
|
"album-name" => a.name,
|
||||||
|
|
Loading…
Reference in New Issue