From: Phrogz Date: 2007-08-26T23:25:03+09:00 Subject: Re: string On Aug 26, 4:07 am, Shai Rosenfeld wrote: > this may be a slightly unrelated question, but i was hoping someone had > some small quick answer for me .. 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", "") > end You need to .save the individual Food records. Something like (untested): Food.find(:all).each{ |food| food.fruit = food.fruit.gsub( "really", "" ) food.save }