From 827a5e52e7e266636de690c24b0224e1c6101b37 Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Thu, 14 Nov 2013 10:34:18 +0800 Subject: [PATCH] Fix gallery front end when display all categories --- .../panel/gallery/front_end/albums_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb index b6fab8602..01e19382e 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb @@ -1,6 +1,10 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController def index - @albums = GalleryAlbum.where(:category_id.in => params[:category_id]) + if params[:category_id].blank? + @albums = GalleryAlbum.where() + else + @albums = GalleryAlbum.where(:category_id.in => params[:category_id]) + end end def show