More Rails sugar :)

['one', 'two', 'three'].to_sentence => "one, two, and three"

and also some flexibility:

['one', 'two', 'three'].to_sentence(words_connector: ', ', last_word_connector: ' and ') => "one, two and three"

Leave a Reply

Your email address will not be published. Required fields are marked *