summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb24
1 files changed, 5 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