Reputation: 43
<div style="--rating: <%= rating_value %>">
^Work's fine
but doesn't work with .erb syntax.
<%= content_tag :div, style: "--rating: <%= rating_value %>" %>
what am I missing? Thanx for the answer!
Upvotes: 2
Views: 347
Reputation: 1208
This should work:
<%= content_tag :div, style: "--rating: #{rating_value}" %>
Upvotes: 1