From f23115bde59f2abbd559fbffe045e1703c5f2199 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 21 Apr 2014 15:39:13 +0800 Subject: [PATCH] changed the filtering and some other stuff --- app/controllers/announcements_controller.rb | 4 ++-- app/models/bulletin.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index ce48dab..61487c1 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -1,7 +1,7 @@ class AnnouncementsController < ApplicationController def index - announcements = Bulletin.all + announcements = Bulletin.filter_by_categories anns = announcements.collect do |a| { "title" => a.title, @@ -34,7 +34,7 @@ class AnnouncementsController < ApplicationController def show - params = OrbitHelper.get_params + params = OrbitHelper.params announcement = Bulletin.find_by_param(params[:uid]) { "title" => announcement.title, diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index 6cce923..15f759f 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -12,4 +12,5 @@ class Bulletin def self.find_by_param(input) self.find_by(uid: input) end + end