How to render a ruby variable alongside other content in a block? #579
-
Hello, <ul>
<li>
<span class="icon"></span>
Here the text
</li>
</ul> My code in Phlex looks like this: ul do
benefits.each do |benefit|
li do
span class: "icon"
benefit
end
end
end but this only renders the icon, not the text inside So is there a way I can have both a tag and dynamic text? |
Beta Was this translation helpful? Give feedback.
Answered by
joeldrapper
Jun 12, 2023
Replies: 1 comment 2 replies
-
Hey @quaasy, you can use the ul do
benefits.each do |benefit|
li do
span class: "icon"
plain benefit
end
end
end |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
quaasy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @quaasy, you can use the
plain
method to do this.