Check out example codes for "update a database in ruby". It will help you in understanding the concepts better.

Code Example 1

def update
    sql = <<-SQL
    UPDATE dogs SET name = ?, breed = ? WHERE id = ?
    SQL

    DB[:conn].execute(sql, self.name, self.breed, self.id)
  end

Learn ReactJs, React Native from akashmittal.com