I ran into a problem whilst trying to titleizeĀ a string containing an acronym. For example:

"building an API".titleize

Will output

=> "Building An Api"

Not exactly what I was after but with a small change to the Inflector class you can define your own acronyms.

config/initializers/inflections.rb

ActiveSupport::Inflector.inflections do |inflect|
      inflect.acronym "API"
  end

Now:

"Building An API".titleize