Mysql string

hi, hope u’r all having a good week ahead -

does anyone know how to modify / change existing text in a db?

with the code

@foods = Food.find(:all)
food_rows = @foods.collect(&:fruit)
food_rows.each |r|
r.gsub(“really”, “”)

i get a good end result (if the data was

Food.find(1).fruit = “we really need apples”
Food.find(2).fruit = “we really need kiwis”
Food.find(3).fruit = “we really need oranges”

that is, after the code, i get

“we need apples”
“we need kiwis”
“we need oranges”

which is good, but that is the program’s output. i was wondering whether
someone knew a way to do this, that modifies the data in the database

thanks for the hassle

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs