From fc35327d1144f218e3b2fcb15e5aab08ee0d9a02 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 21 Sep 2015 15:56:15 +0800 Subject: [PATCH] fixed json for nccu --- app/controllers/admin/newsbulletins_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/newsbulletins_controller.rb b/app/controllers/admin/newsbulletins_controller.rb index 0a80e5a..40c8df3 100644 --- a/app/controllers/admin/newsbulletins_controller.rb +++ b/app/controllers/admin/newsbulletins_controller.rb @@ -15,7 +15,7 @@ class Admin::NewsbulletinsController < ApplicationController keyword = Regexp.new(".*"+params[:keyword]+".*") bulletins = NewsBulletin.any_of({:title=>keyword},{:subtitle=>keyword},{:text=>keyword}) else - bulletins = NewsBulletin.all + bulletins = NewsBulletin.all.can_display end bulletins = bulletins.where(:is_hot => params[:is_hot]) if !params[:is_hot].blank? @@ -53,7 +53,7 @@ class Admin::NewsbulletinsController < ApplicationController end rescue nil text = {"en" => "", "zh_tw" => ""} - text["en"] = (b.text_translations["en"].nil? ? "" :smart_convertor(b.text_translations["en"])) + text["en"] = (b.text_translations["en"].nil? ? "" : smart_convertor(b.text_translations["en"])) text["zh_tw"] = (b.text_translations["zh_tw"].nil? ? "" : smart_convertor(b.text_translations["zh_tw"])) author = User.find(b.create_user_id).member_profile.name rescue ""