Pass template object to Handler#compile
This commit is contained in:
parent
a0748848b6
commit
1959db3246
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue