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') well as several other variations without success.

1 answer

  • answered 2018-01-12 19:45 Sergey Sokolov

    li class=(is_active_controller('dashboards'))