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?
Asked
Active
Viewed 1.7k times
46
spike
- 9,514
- 8
- 50
- 82
1 Answers
94
Yeah to_sentence ought to work nicely.
Webjedi
- 4,627
- 5
- 39
- 57
-
18Just when I thought I couldn't be more impressed with Rails, I run into this beauty... – Matthew Clark Jun 20 '14 at 20:50