forked from phlex-ruby/phlex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Array and Set attribute values (phlex-ruby#546)
This adds support for Array or Set attribute values like this: ```ruby div(class: ["bg-red-500", "rounded"]) # or div(class: Set["bg-red-500", "rounded"]) ``` Array or Set attribute values will be treated like a token list, and its members will be joined with a space. This works as long as all elements are either strings or symbols. Additionally, this change removes the implicit conversion of attribute values to a string by calling `to_s` on anything that is not recognized. Now attribute values that are not either a String, a Symbol, an Array, a Set, or a Hash with values of one of these types, will raise an ArgumentError.
- Loading branch information
1 parent
504da6a
commit 5e0ca1f
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters