lib/action_view/base.rb in actionpack-0.9.5 vs lib/action_view/base.rb in actionpack-1.0.0
- old
+ new
@@ -139,11 +139,11 @@
class_eval("include ActionView::Helpers::#{helper_module_name}") if Helpers.const_defined?(helper_module_name)
end
end
- def self.controller_delegate(*methods)
+ def self.controller_delegate(*methods)#:nodoc:
methods.flatten.each do |method|
class_eval <<-end_eval
def #{method}(*args, &block)
controller.send(%(#{method}), *args, &block)
end
@@ -236,11 +236,12 @@
def full_template_path(template_path, extension)
"#{@base_path}/#{template_path}.#{extension}"
end
def template_exists?(template_path, extension)
- FileTest.exists?(full_template_path(template_path, extension))
+ (cache_template_loading && @@loaded_templates.has_key?(template_path)) ||
+ FileTest.exists?(full_template_path(template_path, extension))
end
def read_template_file(template_path)
unless cache_template_loading && @@loaded_templates[template_path]
@@loaded_templates[template_path] = File.read(template_path)
@@ -248,10 +249,10 @@
@@loaded_templates[template_path]
end
def rhtml_render(template, binding)
- @@compiled_erb_templates[template] ||= ERB.new(template)
+ @@compiled_erb_templates[template] ||= ERB.new(template, nil, '-')
@@compiled_erb_templates[template].result(binding)
end
def rxml_render(template, binding)
@controller.headers["Content-Type"] ||= 'text/xml'