How to convert this ERB to the Slim template language?
-
28-06-2021 - |
Question
I'm using the Slim template language (http://slim-lang.com/).
Can someone please tell me how to convert this ERB to be used in a friends.html.slim template?
data/people.yaml
friends:
- Tom
- Dick
- Harry
ERB
<ol>
<% data.people.friends.each do |f| %>
<li><%= f %></li>
<% end %>
</ol>
Solution
More a question than an answer, because I'm sort-of assuming you already did this:
ol
- for f in data.people.friends do
li = f
If that didn't work, please describe what you did try, and what didn't work.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow