aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/inflector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/inflector.rb')
-rw-r--r--activesupport/lib/inflector.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/inflector.rb b/activesupport/lib/inflector.rb
index f84a45ea7f..6c8a60e6c4 100644
--- a/activesupport/lib/inflector.rb
+++ b/activesupport/lib/inflector.rb
@@ -27,6 +27,10 @@ module Inflector
camel_cased_word.to_s.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').downcase
end
+ def humanize(lower_case_and_underscored_word)
+ lower_case_and_underscored_word.to_s.gsub(/_/, " ").capitalize
+ end
+
def demodulize(class_name_in_module)
class_name_in_module.to_s.gsub(/^.*::/, '')
end