title: ruby with csv file add next line automatically
body: <pre><code>def supplier_registeration
  
      print "Registration form :"
      print "\nName :"
      name = gets.chomp.downcase
      print "User Name :"
      user_name = gets.chomp.downcase
      print "Password :"
      password = gets.chomp.downcase
      print "contact :"
      contact = gets.chomp.to_i
      print "address :"
      address = gets.chomp.downcase 
  
      CSV.open("source/supplier.csv", "wb") do |csv|
        csv &lt;&lt; ["name", "user name", "password", "contact", "address"]
        csv &lt;&lt; [name, user_name, password, contact, address]
      end
      print "Registration successfully..!\n"
      supplier
  
  end
  </code></pre>
  
  <p>This method writes to the CSV file, but on the next registration entry, my file rewrites the initial data. How do I append user input to the next line automatically?</p>