[ACCEPTED]-Ruby ternary operator in erb?-ternary-operator
Accepted answer
<span style="color:<%= manuscript.uploaded_to_s3? ? 'green' : 'red' %>">
I would advocate a CSS class rather than 1 style attribute 8P:
<span class="<%= manuscript.uploaded_to_s3? ? 'green' : 'red' %>">
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.