does anyone know how to modify / change existing text in a db (replace
func.) ?
something like -
========DB=======
table foods
column fruit
row 1
"we really need to bring apples and fruit"
row 2
"we really need to bring oranges and mangos"
row 2
"we really need to bring apricots"
=======end result needed=====
table foods
column fruit
row 1
"we need to bring apples and fruit"
row 2
"we need to bring oranges and mangos"
row 2
"we need to bring apricots"
========================
it would be something along the lines of the code below, but this only
modifies the text shown at the end program; i need the text modified IN
the db.
@foods = Food.find(:all)
food_rows = @foods.collect(&:fruit)
food_rows.each |r|
r.gsub("really", "")
end
any help? many thanks for any tips.
shai
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---