Check out example codes for "how to create an SQL save method in ruby". It will help you in understanding the concepts better.
Code Example 1
def save
sql = <<-SQL
INSERT INTO songs (name, album)
VALUES (?, ?)
SQL
DB[:conn].execute(sql, self.name, self.album)
end
Learn ReactJs, React Native from akashmittal.com