Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to create an SQL save method in ruby

 def save
    sql = <<-SQL
      INSERT INTO songs (name, album) 
      VALUES (?, ?)
    SQL
 
    DB[:conn].execute(sql, self.name, self.album)
  end
 
PREVIOUS NEXT
Tagged: #create #SQL #save #method #ruby
ADD COMMENT
Topic
Name
1+5 =