Fixed compile of template fails if template name contains non-word character #1802

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-07-22 07:39:48 +00:00
parent fb2dd492d6
commit 95cd46c5ec

View File

@@ -304,8 +304,9 @@ module ActionView #:nodoc:
i = file_name.index(@base_path)
l = @base_path.length
s_file_name = i ? file_name[i+l+1,file_name.length-l-1] : file_name
s_file_name.gsub!(/\/|:/, '_')
s_file_name.sub!(/.rhtml/,'')
s_file_name.sub!(/.rhtml$/,'')
s_file_name.tr!('/:-', '_')
s_file_name.gsub!(/[^a-zA-Z0-9_]/){|s| s[0].to_s}
erb_name += s_file_name
else
@@erb_count += 1