Pass template object to Handler#compile

This commit is contained in:
Pratik Naik 2008-04-24 16:58:09 +01:00
parent a0748848b6
commit 1959db3246
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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: