You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm aware that you can do html_attributes("data-value": nil) if condition? to return "data-value" if the condition is truthy.
Is that the cleanest / only format? On reading the code, I briefly thought html_attributes("data-value") if condition? might work, but I overlooked the stringify_keys statement that means it needs to be a hash.
Would a PR to support strings, or arrays of strings, in the method be considered?
Or is this more a case of we've provided a basic clean interface to prevent too much magic producing bad HTML, so the preference is not sprinkle too much interface overloading magic in?!
The text was updated successfully, but these errors were encountered:
So I'm aware that you can do
html_attributes("data-value": nil) if condition?
to return"data-value"
if the condition is truthy.Is that the cleanest / only format? On reading the code, I briefly thought
html_attributes("data-value") if condition?
might work, but I overlooked thestringify_keys
statement that means it needs to be a hash.Would a PR to support strings, or arrays of strings, in the method be considered?
Or is this more a case of we've provided a basic clean interface to prevent too much magic producing bad HTML, so the preference is not sprinkle too much interface overloading magic in?!
The text was updated successfully, but these errors were encountered: