added search box

This commit is contained in:
Harry Bomrah 2016-09-02 18:29:50 +08:00
parent a0dec48727
commit 310297f01b
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,9 @@ class Admin::GalleriesController < OrbitAdminController
@filter_fields = filter_fields(categories, @tags) @filter_fields = filter_fields(categories, @tags)
@filter_fields.delete(:status) @filter_fields.delete(:status)
@albums = Album.where(:order => -1).desc(:created_at).with_categories(filters("category")).with_tags(filters("tag")) @albums = Album.where(:order => -1).desc(:created_at).with_categories(filters("category")).with_tags(filters("tag"))
@albums = search_data(@albums,[:name])
albums = Album.where(:order.gt => -1).asc(:order).with_categories(filters("category")).with_tags(filters("tag")) albums = Album.where(:order.gt => -1).asc(:order).with_categories(filters("category")).with_tags(filters("tag"))
albums = search_data(albums,[:name])
@albums = @albums.concat(albums) @albums = @albums.concat(albums)
if request.xhr? if request.xhr?