mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user