Skip to content
This repository
Browse code

Pass template object to Handler#compile

  • Loading branch information...
commit 1959db324653d5db345b935c9d2696c544d836af 1 parent a074884
Pratik authored April 24, 2008
2  actionpack/lib/action_view/template_handlers/builder.rb
@@ -13,7 +13,7 @@ def compile(template)
13 13
         content_type_handler = (@view.send!(:controller).respond_to?(:response) ? "controller.response" : "controller")
14 14
         "#{content_type_handler}.content_type ||= Mime::XML\n" +
15 15
         "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" +
16  
-        template +
  16
+        template.source +
17 17
         "\nxml.target!\n"
18 18
       end
19 19
 
2  actionpack/lib/action_view/template_handlers/compilable.rb
@@ -95,7 +95,7 @@ def compiled_method_name_file_path_segment(file_name)
95 95
 
96 96
       # Method to create the source code for a given template.
97 97
       def create_template_source(template, render_symbol)
98  
-        body = compile(template.source)
  98
+        body = compile(template)
99 99
 
100 100
         self.template_args[render_symbol] ||= {}
101 101
         locals_keys = self.template_args[render_symbol].keys | template.locals.keys
2  actionpack/lib/action_view/template_handlers/erb.rb
@@ -43,7 +43,7 @@ class ERB < TemplateHandler
43 43
       include Compilable
44 44
 
45 45
       def compile(template)
46  
-        ::ERB.new(template, nil, @view.erb_trim_mode).src
  46
+        ::ERB.new(template.source, nil, @view.erb_trim_mode).src
47 47
       end
48 48
 
49 49
       def cache_fragment(block, name = {}, options = nil) #:nodoc:
2  actionpack/lib/action_view/template_handlers/rjs.rb
@@ -9,7 +9,7 @@ def self.line_offset
9 9
 
10 10
       def compile(template)
11 11
         "controller.response.content_type ||= Mime::JS\n" +
12  
-        "update_page do |page|\n#{template}\nend"
  12
+        "update_page do |page|\n#{template.source}\nend"
13 13
       end
14 14
 
15 15
       def cache_fragment(block, name = {}, options = nil) #:nodoc:

0 notes on commit 1959db3

Please sign in to comment.
Something went wrong with that request. Please try again.