Use #tr instead of #gsub where possible
This commit is contained in:
parent
4cd57a88b4
commit
afb92754c8
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue