diff options
author | elijah <elijah@riseup.net> | 2013-02-20 00:39:58 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-02-20 00:39:58 -0800 |
commit | 10038e58efe3aa3c1725e2b5b0a0b7b2ce060df7 (patch) | |
tree | 53413a9cd679c6d22b405c1035f9c41546677c9a /app/controllers | |
parent | 9c4e765c8fe972a4a9f49c3de7991b3925ddb97c (diff) |
added support for pandoc and page properties in static markup.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 24 | ||||
-rw-r--r-- | app/controllers/pages_controller.rb | 1 |
2 files changed, 6 insertions, 19 deletions
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 diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index acf525c..3e76092 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -14,6 +14,7 @@ class PagesController < ApplicationController format.atom { render_atom_feed(@page) } end else + logger.error("ERROR: could not find page %s" % params[:page]) raise PageNotFound.new end end |