ActionView::Helpers::OutputSafetyHelper
def to_sentence(array, options = {})

Description

Returns a string joining the elements of the array like an English sentence.

Arguments

Changing a value updates the ERB and HTML.

Joins the elements like an English sentence (Fish, Chips, and Peas), escaping the elements and the connectors unless they are html_safe. The connectors come from the support.array translation; on this page, these are Rails' English defaults (, , and and , and ).
options= {}
"; "
With three or more items, the string put between each pair except the last.
" + "
With exactly two items, the string put between them.
" and also "
With three or more items, the string put between the last two.
Options not listed here raise ArgumentError, except :locale, which sets the language of the support.array translation.

ERB

Changes from the previous output: Added Removed Changed


          

HTML