lamu
lamu

Reputation: 215

ruby inside slim strings

In erb files I can do something like

<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">

How would this line look in a slim file? Thx.

Upvotes: 2

Views: 1306

Answers (2)

Spooner
Spooner

Reputation: 427

Alternatively:

tr[class=cycle('list_line_odd', 'list_line_even')]

or

tr class=cycle('list_line_odd', 'list_line_even')

Upvotes: 5

msorc
msorc

Reputation: 917

tr[class="#{cycle('list_line_odd', 'list_line_even')}"]

Upvotes: 1

Related Questions