aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector/methods.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-07-23 12:15:41 +0200
committerXavier Noria <fxn@hashref.com>2011-07-23 12:15:41 +0200
commitace3723d2fcb1a96d51c2c82050594129328d7c0 (patch)
treed95d16b7dfee13037987913ed71d1708b5484f15 /activesupport/lib/active_support/inflector/methods.rb
parent94978b9a46173b875bcb0d5cb724e5119e4aa8f4 (diff)
parent38310ab1a6f559860e25b0e28bef9560bb452ae6 (diff)
downloadrails-ace3723d2fcb1a96d51c2c82050594129328d7c0.tar.gz
rails-ace3723d2fcb1a96d51c2c82050594129328d7c0.tar.bz2
rails-ace3723d2fcb1a96d51c2c82050594129328d7c0.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'activesupport/lib/active_support/inflector/methods.rb')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 3d28d33f40..423b5abd20 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -118,8 +118,10 @@ module ActiveSupport
# +titleize+ is also aliased as as +titlecase+.
#
# Examples:
- # "man from the boondocks".titleize # => "Man From The Boondocks"
- # "x-men: the last stand".titleize # => "X Men: The Last Stand"
+ # "man from the boondocks".titleize # => "Man From The Boondocks"
+ # "x-men: the last stand".titleize # => "X Men: The Last Stand"
+ # "TheManWithoutAPast".titleize # => "The Man Without A Past"
+ # "raiders_of_the_lost_ark".titleize # => "Raiders Of The Lost Ark"
def titleize(word)
humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
end