title: One-line assignment: If (condition) variable = value1 else value2
body: <p>How do I do something like this?</p>
  
  <pre><code>if params[:property] == nil 
   @item.property = true
  else 
   @item.property = false
  </code></pre>
  
  <p>Always forget the proper syntax to write it in one line.</p>
  
  <p>In PHP it would be like this:</p>
  
  <pre><code>@item.property=(params[:property]==nil)true:false
  </code></pre>
  
  <p>Is it the same in rails?</p>