Capitalizing 2 words


If I enter a city name that is two words long, ex. san francisco, How do I make the code capitalize both words?

print "What city do you live in?"
city = gets.chomp
city2 = city.capitalize


google search
== discussions / opinions ==
ruby capitalize multiple words


Can someone post a solution with an explanation of the methods?

leonhard, I see several solutions, but they are using methods we are not familiar with. I think what both microblaster and I need are explanations how how these are done.