diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 07:39:48 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 07:39:48 +0000 |
commit | 95cd46c5ec496a02013d3918673cfae2d1922ac8 (patch) | |
tree | a190d60366ab592e53960e10ed25cb2cad4d96fe | |
parent | fb2dd492d6c73207d7fad2ee1df152713e1dcaa9 (diff) | |
download | rails-95cd46c5ec496a02013d3918673cfae2d1922ac8.tar.gz rails-95cd46c5ec496a02013d3918673cfae2d1922ac8.tar.bz2 rails-95cd46c5ec496a02013d3918673cfae2d1922ac8.zip |
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
-rw-r--r-- | actionpack/lib/action_view/base.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 4869f8f555..4004ad3326 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -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 |