Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed compile of template fails if template name contains non-word ch…

…aracter #1802

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 95cd46c5ec496a02013d3918673cfae2d1922ac8 1 parent fb2dd49
@dhh dhh authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_view/base.rb
View
5 actionpack/lib/action_view/base.rb
@@ -304,8 +304,9 @@ def compile_erb_template(template, file_name)
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
Please sign in to comment.
Something went wrong with that request. Please try again.