One line if statement not working

前端 未结 8 922
遥遥无期
遥遥无期 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:42

    You can Use ----

    (@item.rigged) ? "Yes" : "No"

    If @item.rigged is true, it will return 'Yes' else it will return 'No'

提交回复
热议问题