To Sentence
Check out the Rails to_sentence
method, which takes an array and returns a stringified sentence.
pry(main)> %w(one two three).to_sentence
=> "one, two, and three"
Really handy in the view layer. This method also accepts some interesting options like :words_connector
and :locale
.