-
-
Save paulcsmith/3d1b521e75b2a4e6bffa8a971ad96876 to your computer and use it in GitHub Desktop.
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
d("#foo.whatever.foo") do | |
end | |
private def d(id_and_or_class : String, **other_args) | |
id = id_and_or_class.split(".").find?(&.starts_with?("#")) | |
classes = id_and_or_class.split(".").reject(&.starts_with?("#")) | |
div(id: id.to_s, class: classes.join(" "), **other_args) do | |
yield | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment