Your first code can simply be replaced with this:
= value ? "yes" : "no"
Any lines starting with =
are evaluated, and the resulting return value is inserted into the document after a call to escape_html
.
Because you explained in your comments that you actually want HTML code to be inserted, you'll have to do this:
== value ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>'