Why does the titlecase mess up the name? I have:
titlecase
John Mark McMillan
and it turns it into:
>> \"john mark McM
Hmm, that's odd.. but you could write a quick custom regex to avoid using that method.
class String def custom_titlecase self.gsub(/\b\w/) { |w| w.upcase } end end "John Mark McMillan".custom_titlecase # => "John Mark McMillan"
Source