Quick update question

Dave Amos
Fri, 28 Dec 2007 15:16:26 -0000

Hi there,

I''m trying to take a few variables and update an entry in a database,
and I don''t know the best way to do it. Here''s what
I''ve been trying in
my controller:

var1 = whatever
var2 = whatever
guess = Guess.find(params[:id])
guess.update_attributes(:col_1 => var1, :col_2 => var2)

Can I use .update_attributes in that way? Is there a better way to do
this? Thanks in advance for helping a newbie.
--
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
-~----------~----~----~----~------~----~------~--~---