1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #17150 from effektz/tr-instead-of-gsub

Use #tr instead of #gsub where possible
This commit is contained in:
Jeremy Kemper 2014-10-03 15:39:58 -07:00
commit 657ce17868
2 changed files with 2 additions and 2 deletions

View file

@ -862,7 +862,7 @@ module ActionView
# see http://www.w3.org/TR/html4/types.html#type-name
def sanitize_to_id(name)
name.to_s.delete(']').gsub(/[^-a-zA-Z0-9:.]/, "_")
name.to_s.delete(']').tr('^-a-zA-Z0-9:.', "_")
end
end
end

View file

@ -321,7 +321,7 @@ module ActionView
end
def identifier_method_name #:nodoc:
inspect.gsub(/[^a-z_]/, '_')
inspect.tr('^a-z_', '_')
end
def instrument(action, &block)