aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index bc3d8d5e52..2cda3d94b5 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -17,6 +17,18 @@ module ActionView #:nodoc:
@locals = locals || {}
@handler = self.class.handler_class_for_extension(@extension).new(@view)
end
+
+ def render_template
+ render
+ rescue Exception => e
+ raise e unless filename
+ if TemplateError === e
+ e.sub_template_of(filename)
+ raise e
+ else
+ raise TemplateError.new(self, @view.assigns, e)
+ end
+ end
def render
prepare!