From c5ce9154359be2341becbb241f3b3c6e36577c38 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Mon, 13 Apr 2015 14:18:41 +0800 Subject: [PATCH] fix view_count --- app/controllers/page_contents_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/page_contents_controller.rb b/app/controllers/page_contents_controller.rb index afc8a05..204557e 100644 --- a/app/controllers/page_contents_controller.rb +++ b/app/controllers/page_contents_controller.rb @@ -5,7 +5,7 @@ class PageContentsController < OrbitAdminController url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/page_contents/new?page_id=#{page.id.to_s}" : "" { "html" => (page.page_contexts.last.content rescue ""), - "view_count" => (page.page_contexts.last.view_count rescue ""), + "view_count" => (page.view_count rescue ""), "view-count-head" =>t('page_content.view_count'), "url_to_edit" => url_to_edit }