RoR RoR - 1 year ago 83
Ruby Question

One line if statement not working

<%if @item.rigged %>Yes<%else%>No<%end%>

I was thinking of something like this?

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

But it doesn't work. Ruby has the
but I"m not even sure how to use that thing.

Answer Source

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

Ternary operator has form condition ? if_true : if_false

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download