From 80b60671f7216c571ea8711d1de8ca824aefbe54 Mon Sep 17 00:00:00 2001 From: wycats Date: Mon, 17 May 2010 19:41:54 +0400 Subject: Revert "Moved encoding work in progress to a feature branch." This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517. --- actionpack/lib/action_view/template/resolver.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/template/resolver.rb') diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index a223b3a55f..ef44925951 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -70,7 +70,10 @@ module ActionView Dir[query].reject { |p| File.directory?(p) }.map do |p| handler, format = extract_handler_and_format(p, formats) - Template.new(File.read(p), File.expand_path(p), handler, + + contents = File.open(p, "rb") {|io| io.read } + + Template.new(contents, File.expand_path(p), handler, :virtual_path => path, :format => format) end end -- cgit v1.2.3