One line if statement not working

前端 未结 8 911
遥遥无期
遥遥无期 2021-01-29 18:59
<%if @item.rigged %>Yes<%else%>No<%end%>

I was thinking of something like this?

if @item.rigged ? \"Yes\" : \"No\" 
<         


        
8条回答
  •  日久生厌
    2021-01-29 19:31

    Remove if from if @item.rigged ? "Yes" : "No"

    Ternary operator has form condition ? if_true : if_false

提交回复
热议问题