From 1cbe055361f9700fd3030069e606dda77755325c Mon Sep 17 00:00:00 2001 From: JiangRu Date: Wed, 19 Nov 2014 17:50:08 +0800 Subject: [PATCH] update view_count --- app/controllers/announcements_controller.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index ebd2ece..0e0ba29 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -19,7 +19,8 @@ class AnnouncementsController < ApplicationController "link_to_show" => OrbitHelper.url_to_show(a.to_param), "img_src" => a.image.thumb.url || "http://placehold.it/100x100", "img_description" => a.image_description, - "more" => t(:more_plus) + "more" => t(:more_plus), + "view_count" => a.view_count } end { @@ -33,7 +34,7 @@ class AnnouncementsController < ApplicationController "category-head" => t('announcement.table.category') }, "total_pages" => announcements.total_pages - } + } end @@ -68,9 +69,9 @@ class AnnouncementsController < ApplicationController "subtitle-head" => t('announcement.table.sub_title'), "category-head" => t('announcement.table.category') } - } + } end - + def show params = OrbitHelper.params announcement = Bulletin.can_display.find_by(:uid=>params[:uid]) @@ -103,7 +104,7 @@ class AnnouncementsController < ApplicationController }, "impressionist" => (announcement.is_preview ? nil : announcement), "url_to_edit"=>url_to_edit - } + } end - + end