aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-04-24 16:58:09 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-04-24 16:58:09 +0100
commit1959db324653d5db345b935c9d2696c544d836af (patch)
tree5cc858e7a41ca4ee7be4f89713d401b5fe51a206
parenta0748848b646fdda5dd8e4c93b5bd9a0363738eb (diff)
downloadrails-1959db324653d5db345b935c9d2696c544d836af.tar.gz
rails-1959db324653d5db345b935c9d2696c544d836af.tar.bz2
rails-1959db324653d5db345b935c9d2696c544d836af.zip
Pass template object to Handler#compile
-rw-r--r--actionpack/lib/action_view/template_handlers/builder.rb2
-rw-r--r--actionpack/lib/action_view/template_handlers/compilable.rb2
-rw-r--r--actionpack/lib/action_view/template_handlers/erb.rb2
-rw-r--r--actionpack/lib/action_view/template_handlers/rjs.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb
index cff9e6beb8..f76d89777a 100644
--- a/actionpack/lib/action_view/template_handlers/builder.rb
+++ b/actionpack/lib/action_view/template_handlers/builder.rb
@@ -13,7 +13,7 @@ module ActionView
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 35c74f6c51..25bd0fea7f 100644
--- a/actionpack/lib/action_view/template_handlers/compilable.rb
+++ b/actionpack/lib/action_view/template_handlers/compilable.rb
@@ -95,7 +95,7 @@ module ActionView
# 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 f30cf0203c..15a9064461 100644
--- a/actionpack/lib/action_view/template_handlers/erb.rb
+++ b/actionpack/lib/action_view/template_handlers/erb.rb
@@ -43,7 +43,7 @@ module ActionView
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 e0f95205de..5854e33fed 100644
--- a/actionpack/lib/action_view/template_handlers/rjs.rb
+++ b/actionpack/lib/action_view/template_handlers/rjs.rb
@@ -9,7 +9,7 @@ module ActionView
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: