title: How to prevent too many if-else conditions
body: <p>I have controllers that control whether user can rent a product. I have many conditions to check, and each have different outcomes. I have too many <code>if</code> <code>else</code> statements. I wonder what design pattern I can follow to make it more readable.</p>
  
  <pre><code>if current_user
    if rental_valid?
      if current_user.approved
        if eligible_to_use?(product_id)
          # redirect_to payment
        else 
          # redirect_to :back
          # alert not eligible
        end 
      else
        # redirect_to verify_path
      end 
    else
      # redirect_to :back
      # alert, rental not valid
    end 
  else
    # redirect_to login_path
  end
  </code></pre>