ActionView::Helpers::TagHelper

Alias: class_names

def token_list(*args)

Description

Returns a string of tokens joined with spaces.

Arguments

Changing a value updates the ERB and HTML.

= nil
Split at spaces into tokens (such as btn). Returns them joined with spaces, together with the tokens from the other arguments. Duplicate tokens appear only once, and empty strings and nil are dropped (a string starting with a space leaves an empty token, so the result gets an extra space).
= nil
A run of spaces counts as one separator. Tokens already in an earlier argument are removed.
= nil
{active: true, disabled: false}
Keys whose values are not false or nil become tokens.
= nil
["large", nil, "", ["round"]]
Each element is handled like a separate argument. Nested arrays and hashes are handled the same way.

ERB

Changes from the previous output: Added Removed Changed


          

HTML