From 10038e58efe3aa3c1725e2b5b0a0b7b2ce060df7 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 20 Feb 2013 00:39:58 -0800 Subject: added support for pandoc and page properties in static markup. --- app/controllers/application_controller.rb | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b73a463..a9a25f0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -59,30 +59,15 @@ class ApplicationController < ActionController::Base # renders the content of a static page # def render_page(page) - begin - render :template => page.template_path - rescue ActionView::MissingTemplate => exc - begin - render :template => page.template_path(DEFAULT_LOCALE) - rescue - raise exc - end - end + render :text => page.render_to_string(self), :layout => true end + helper_method :render_page # - # same as render page, but returns the string + # same as render page, but returns the string without the layout # def page_body(page) - begin - render_to_string :template => page.template_path - rescue ActionView::MissingTemplate => exc - begin - render_to_string :template => page.template_path(DEFAULT_LOCALE) - rescue - raise exc - end - end + page.render_to_string(self) end helper_method :page_body @@ -114,4 +99,5 @@ class ApplicationController < ActionController::Base # Thread.current[key_name] = true #end + end -- cgit v1.2.3