2014-05-06 09:20:15 +00:00
|
|
|
class PageContentsController < OrbitAdminController
|
2014-08-05 06:45:30 +00:00
|
|
|
def index
|
|
|
|
params = OrbitHelper.params
|
|
|
|
page = Page.where(:page_id => params[:page_id]).first
|
|
|
|
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 ""),
|
|
|
|
"url_to_edit" => url_to_edit
|
|
|
|
}
|
|
|
|
end
|
2014-05-06 09:20:15 +00:00
|
|
|
end
|