ActionView::Helpers::OutputSafetyHelper
def safe_join(array, sep = $,)

Description

Returns an html_safe string joining the elements of the array.

Arguments

Changing a value updates the ERB and HTML.

["<b>Fish</b>", tag.i("Chips")]
Joins the elements with the sep argument. Elements that are not html_safe ("<b>Fish</b>") are escaped, and html_safe elements (the output of tag.i("Chips")) are kept as is. Nested arrays are flattened before joining.
= nil
The string put between the elements. Escaped if it is not html_safe. Defaults to Ruby's $, (usually nil, which puts nothing between them).

ERB

Changes from the previous output: Added Removed Changed


          

HTML


          

Preview