Home How to convert HTML with Ruby helper method ERB into Slim syntax
Reply: 1

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

Scro
1#
Scro Published in 2018-01-12 19:18:30Z

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.

Sergey Sokolov
2#
Sergey Sokolov Reply to 2018-01-12 19:45:57Z
li class=(is_active_controller('dashboards'))
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.31676 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO