Rescue nil content for new page

This commit is contained in:
manson 2014-07-15 17:48:28 +08:00
parent 873de8958b
commit 5608c79d42
1 changed files with 1 additions and 1 deletions

View File

@ -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