Reputation: 10004
Is there a standard rails helper that converts an array of strings like ["apple", "banana", "pear"]
into "apple, banana, and pear"
for inserting into a sentence?
Upvotes: 49
Views: 18974
Reputation: 4737
Yeah to_sentence ought to work nicely.
http://apidock.com/rails/Array/to_sentence
Upvotes: 99