diff options
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 |