rails capitalize each word code example
Example 1: capitalize composed name ruby
require 'active_support/core_ext'
"kirk douglas".titleize #=> "Kirk Douglas"
Example 2: capitalize composed name ruby
'one TWO three foUR'.gsub(/\w+/, &:capitalize)