From 690dba7860c76e5652b0386bfe4fd2143c256f34 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Mon, 13 Apr 2015 14:35:21 +0800 Subject: [PATCH] add page content title --- app/controllers/page_contents_controller.rb | 2 ++ app/views/page_contents/index.html.erb | 1 + 2 files changed, 3 insertions(+) diff --git a/app/controllers/page_contents_controller.rb b/app/controllers/page_contents_controller.rb index 204557e..f3f6f8e 100644 --- a/app/controllers/page_contents_controller.rb +++ b/app/controllers/page_contents_controller.rb @@ -5,6 +5,8 @@ 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 ""), + "title" => (page.name rescue ""), + "view_count" => (page.view_count rescue ""), "view_count" => (page.view_count rescue ""), "view-count-head" =>t('page_content.view_count'), "url_to_edit" => url_to_edit diff --git a/app/views/page_contents/index.html.erb b/app/views/page_contents/index.html.erb index 764ca7b..24b9729 100644 --- a/app/views/page_contents/index.html.erb +++ b/app/views/page_contents/index.html.erb @@ -4,6 +4,7 @@ <%= data["view-count-head"] %>: <%= data["view_count"] %> +

<%= data["title"] %>

<%= data["html"].html_safe %>