Method: ActionView::Helpers::TagHelper#class_names

Defined in:
actionview/lib/action_view/helpers/tag_helper.rb

#class_names(*args) ⇒ Object

Returns a string of class names built from args.

Examples

class_names("foo", "bar")
 # => "foo bar"
class_names({ foo: true, bar: false })
 # => "foo"
class_names(nil, false, 123, "", "foo", { bar: true })
 # => "123 foo bar"

302
303
304
# File 'actionview/lib/action_view/helpers/tag_helper.rb', line 302

def class_names(*args)
  safe_join(build_tag_values(*args), " ")
end