update view_count

This commit is contained in:
JiangRu 2014-11-19 17:50:08 +08:00
parent 0fd7e69981
commit 1cbe055361
1 changed files with 7 additions and 6 deletions

View File

@ -19,7 +19,8 @@ class AnnouncementsController < ApplicationController
"link_to_show" => OrbitHelper.url_to_show(a.to_param), "link_to_show" => OrbitHelper.url_to_show(a.to_param),
"img_src" => a.image.thumb.url || "http://placehold.it/100x100", "img_src" => a.image.thumb.url || "http://placehold.it/100x100",
"img_description" => a.image_description, "img_description" => a.image_description,
"more" => t(:more_plus) "more" => t(:more_plus),
"view_count" => a.view_count
} }
end end
{ {
@ -33,7 +34,7 @@ class AnnouncementsController < ApplicationController
"category-head" => t('announcement.table.category') "category-head" => t('announcement.table.category')
}, },
"total_pages" => announcements.total_pages "total_pages" => announcements.total_pages
} }
end end
@ -68,9 +69,9 @@ class AnnouncementsController < ApplicationController
"subtitle-head" => t('announcement.table.sub_title'), "subtitle-head" => t('announcement.table.sub_title'),
"category-head" => t('announcement.table.category') "category-head" => t('announcement.table.category')
} }
} }
end end
def show def show
params = OrbitHelper.params params = OrbitHelper.params
announcement = Bulletin.can_display.find_by(:uid=>params[:uid]) announcement = Bulletin.can_display.find_by(:uid=>params[:uid])
@ -103,7 +104,7 @@ class AnnouncementsController < ApplicationController
}, },
"impressionist" => (announcement.is_preview ? nil : announcement), "impressionist" => (announcement.is_preview ? nil : announcement),
"url_to_edit"=>url_to_edit "url_to_edit"=>url_to_edit
} }
end end
end end