提交 bdb1fcc3 编写于 作者: R Rick Olson

Fix WSOD due to modification of a formatted template extension so that...

Fix WSOD due to modification of a formatted template extension so that requests to templates like 'foo.html.erb' fail on the second hit.  [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6506 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 142b074e
*SVN*
* Fix WSOD due to modification of a formatted template extension so that requests to templates like 'foo.html.erb' fail on the second hit. [Rick]
* Fix WSOD when template compilation fails [Rick]
* Change ActionView template defaults. Look for templates using the request format first, such as "show.html.erb" or "show.xml.builder", before looking for the old defaults like "show.erb" or "show.builder" [Rick]
......
......@@ -252,7 +252,7 @@ def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc
else
template_extension = pick_template_extension(template_path).to_s
template_file_name = full_template_path(template_path, template_extension)
template_extension.gsub!(/^\w+\./, '') # strip off any formats
template_extension = template_extension.gsub(/^\w+\./, '') # strip off any formats
end
else
template_file_name = template_path
......@@ -267,7 +267,7 @@ def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc
e.sub_template_of(template_file_name)
raise e
else
raise TemplateError.new(find_base_path_for("#{template_path_without_extension}.#{template_extension}"), template_file_name, @assigns, template_source, e)
raise TemplateError.new(find_base_path_for("#{template_path_without_extension}.#{template_extension}") || view_paths.first, template_file_name, @assigns, template_source, e)
end
end
end
......@@ -582,7 +582,7 @@ def compile_template(extension, template, file_name, local_assigns)
logger.debug "Backtrace: #{e.backtrace.join("\n")}"
end
raise TemplateError.new(extract_base_path_from(file_name) || @view_paths.first, file_name || template, @assigns, template, e)
raise TemplateError.new(extract_base_path_from(file_name) || view_paths.first, file_name || template, @assigns, template, e)
end
@@compile_time[render_symbol] = Time.now
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册