From 310297f01b7a04d7c62c8e9dad3ae562bb83abb9 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 2 Sep 2016 18:29:50 +0800 Subject: [PATCH] added search box --- app/controllers/admin/galleries_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index 91dd718..5644b54 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -8,9 +8,11 @@ class Admin::GalleriesController < OrbitAdminController @filter_fields = filter_fields(categories, @tags) @filter_fields.delete(:status) @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 = search_data(albums,[:name]) @albums = @albums.concat(albums) - + if request.xhr? render :partial => "album", :collection => @albums end