Search code examples
rubyerbslim-lang

Convert erb ruby code to slim template


Below is an erb ruby code which is want to convert in slim template

    <div class="star-rating" data-score= <%= review.rating%> ></div>

In above template i am confused as there are two equals to sign

online converter is giving something like this

.star-rating data-score="<haml_loud"  review.rating &gt;

But its not working


Solution

  • This will work for you:

    .star-rating data-score=review.rating
    

    Since you're (apparently) using Slim, not Haml, you don't need haml_loud at all.