标签: ruby ruby-on-rails-3
是否有标准的rails帮助器将["apple", "banana", "pear"]之类的字符串数组转换为"apple, banana, and pear"以插入句子?
["apple", "banana", "pear"]
"apple, banana, and pear"
答案 0 :(得分:69)
是的__sentence应该很好地工作。
http://apidock.com/rails/Array/to_sentence