From 52c01d4af9e6a5a7324a5cbc688fb731903d8c32 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Thu, 25 Dec 2014 10:54:58 +0800 Subject: [PATCH] fix front tag --- app/controllers/announcements_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 00775e3..83341cf 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -1,7 +1,11 @@ class AnnouncementsController < ApplicationController def index - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.order_by(:postdate=>'desc').filter_by_categories.filter_by_tags(OrbitHelper.params['tags']) + if !OrbitHelper.params['tags'].blank? + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.order_by(:postdate=>'desc').filter_by_tags(OrbitHelper.params['tags']).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count) + else + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.order_by(:postdate=>'desc').filter_by_categories.filter_by_tags + end anns = announcements.collect do |a| statuses = a.statuses_with_classname.collect do |status|