fix capitalize
who knew that capitalise downcases everything else
This commit is contained in:
parent
cae5e323ec
commit
29f43eba3b
10
lib/risc.rb
10
lib/risc.rb
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user