I’m trying to output some html in view inside the ternary operator:
<%params[:type]=="0" ? "<span class=\"active\">Links</span>" : link_to("Links",:type=>0)%>
It doesn’t work as instead of link or span element it outputs me html tags <span class="active">Links</span>
I’m new to ruby/rails, tried to move <%= %> tags, but can’t find a way to do it.
try with raw method:
or the html_safe: