Scro
Scro

Reputation: 1443

How to convert HTML with Ruby helper method ERB into Slim syntax

Trying to convert some HTML code in a template to Slim syntax. The original code uses a Ruby helper method (in Rails) to dynamically determine the class of the li element.

Here is the original code in HTML:

<li class="<%= is_active_controller('dashboards') %>">

The online converter gives:

| <li class="
= is_active_controller('dashboards')
| ">

This not only is ugly and clunky--it doesn't work.

I've tried various options without success. Such as:

li class=is_active_controller('dashboards')

...as well as several other variations without success.

Upvotes: 0

Views: 529

Answers (1)

Sergey Sokolov
Sergey Sokolov

Reputation: 994

li class=(is_active_controller('dashboards'))

Upvotes: 0

Related Questions