Zoolander
Zoolander

Reputation: 2363

How to convert this ERB to the Slim template language?

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>

Upvotes: 1

Views: 628

Answers (1)

Dave Newton
Dave Newton

Reputation: 160170

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.

Upvotes: 3

Related Questions