How do I use the conditional operator (? :) in Ruby?

前端 未结 7 2469
無奈伤痛
無奈伤痛 2020-11-22 10:34

How is the conditional operator (? :) used in Ruby?

For example, is this correct?

<% question = question.size > 20 ? question.ques         


        
7条回答
提交回复
热议问题