What is the way to generate, let's say, two span elements inside a div element in a phoenix framework's view?
In order to do that it's possible to just use an array and pass it inside as the div tag's value like this:
def div_with_spans do
content_tag :div, class: "test" do
[
content_tag(:span, "foo"),
content_tag(:span, "bar")
]
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With