1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #37995 from abhaynikam/37918-fix-typo-in-class_names-helper-documentation

Fixed typo in the class_names helper documentation
This commit is contained in:
Ryuta Kamizono 2019-12-17 15:04:50 +09:00 committed by GitHub
commit 0c2bb3485c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -298,7 +298,7 @@ module ActionView
# class_names({ foo: true, bar: false })
# # => "foo"
# class_names(nil, false, 123, "", "foo", { bar: true })
# # => "foo bar"
# # => "123 foo bar"
def class_names(*args)
safe_join(build_tag_values(*args), " ")
end

View file

@ -347,6 +347,7 @@ class TagHelperTest < ActionView::TestCase
assert_equal "song", class_names(["song", { foo: false }])
assert_equal "song play", class_names({ "song": true, "play": true })
assert_equal "", class_names({ "song": false, "play": false })
assert_equal "123", class_names(nil, "", false, 123, { "song": false, "play": false })
end
def test_content_tag_with_data_attributes