diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb index cff9e6beb86a27b263a01deed6eb960afd032753..f76d89777aba27d18de16ea51c2ec8a650c96277 100644 --- a/actionpack/lib/action_view/template_handlers/builder.rb +++ b/actionpack/lib/action_view/template_handlers/builder.rb @@ -13,7 +13,7 @@ def compile(template) content_type_handler = (@view.send!(:controller).respond_to?(:response) ? "controller.response" : "controller") "#{content_type_handler}.content_type ||= Mime::XML\n" + "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" + - template + + template.source + "\nxml.target!\n" end diff --git a/actionpack/lib/action_view/template_handlers/compilable.rb b/actionpack/lib/action_view/template_handlers/compilable.rb index 35c74f6c51bdbe3cb8817e351a46ce12c32b6b91..25bd0fea7f5c8a155bb70abd04256203260e7713 100644 --- a/actionpack/lib/action_view/template_handlers/compilable.rb +++ b/actionpack/lib/action_view/template_handlers/compilable.rb @@ -95,7 +95,7 @@ def compiled_method_name_file_path_segment(file_name) # Method to create the source code for a given template. def create_template_source(template, render_symbol) - body = compile(template.source) + body = compile(template) self.template_args[render_symbol] ||= {} locals_keys = self.template_args[render_symbol].keys | template.locals.keys diff --git a/actionpack/lib/action_view/template_handlers/erb.rb b/actionpack/lib/action_view/template_handlers/erb.rb index f30cf0203cd113815328d0b982571e9880c712d5..15a9064461f971e7a86ec7a6d72fe53a19eaeb1c 100644 --- a/actionpack/lib/action_view/template_handlers/erb.rb +++ b/actionpack/lib/action_view/template_handlers/erb.rb @@ -43,7 +43,7 @@ class ERB < TemplateHandler include Compilable def compile(template) - ::ERB.new(template, nil, @view.erb_trim_mode).src + ::ERB.new(template.source, nil, @view.erb_trim_mode).src end def cache_fragment(block, name = {}, options = nil) #:nodoc: diff --git a/actionpack/lib/action_view/template_handlers/rjs.rb b/actionpack/lib/action_view/template_handlers/rjs.rb index e0f95205de41305d3690ea286c9ec3a63bedcfd1..5854e33fedec40a32e00c707e26bc624b8e8be57 100644 --- a/actionpack/lib/action_view/template_handlers/rjs.rb +++ b/actionpack/lib/action_view/template_handlers/rjs.rb @@ -9,7 +9,7 @@ def self.line_offset def compile(template) "controller.response.content_type ||= Mime::JS\n" + - "update_page do |page|\n#{template}\nend" + "update_page do |page|\n#{template.source}\nend" end def cache_fragment(block, name = {}, options = nil) #:nodoc: