public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Use sub instead of gsub

Signed-off-by: Joshua Peek <josh@joshpeek.com>
Tarmo Tänav (author)
Mon Jul 14 16:02:59 -0700 2008
josh (committer)
Mon Jul 14 16:02:59 -0700 2008
commit  d27dd860c7f4f9b9e5aebe7d0c6e9b6108d8717c
tree    dd1dd1e9ec8523099ad6f984d8ec409fcf187012
parent  9dc258d6147c8dab772d1f041098a38389cd3e73
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ module ActionView
0
     # So you can not set or modify any instance variables
0
 
0
     def variable_name
0
-      @variable_name ||= name.gsub(/^_/, '').to_sym
0
+      @variable_name ||= name.sub(/\A_/, '').to_sym
0
     end
0
 
0
     def counter_name

Comments