fix capitalize

who knew that capitalise downcases everything else
This commit is contained in:
Torsten Ruger 2018-04-06 20:54:27 +03:00
parent cae5e323ec
commit 29f43eba3b

View File

@ -1,6 +1,14 @@
class String
def camelize
self.split("_").collect( &:capitalize ).join
self.split("_").collect{|str| str.capitalize_first }.join
end
def capitalize_first
self[0].capitalize + self[1..-1]
end
end
class Symbol
def camelize
self.to_s.camelize.to_sym
end
end