From 5608c79d422918fa646a80106e537afa851c7289 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 15 Jul 2014 17:48:28 +0800 Subject: [PATCH] Rescue nil content for new page --- 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 17e4730..1c35de9 100644 --- a/app/controllers/page_contents_controller.rb +++ b/app/controllers/page_contents_controller.rb @@ -3,7 +3,7 @@ class PageContentsController < OrbitAdminController params = OrbitHelper.params page = Page.where(:page_id => params[:page_id]).first { - "html" => page.page_contexts.last.content + "html" => (page.page_contexts.last.content rescue "") } end end \ No newline at end of file