Hi, Here is my code to update an attribute of one record: @person = Person.find($person_id) @person.update_attribute(:FIRST_NAME , "ANDY") It did not update the FRIST_NAME Bryan to ANDY in the database table, but it did change in @person variable. Any idea??? Thanks, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello, I forget that the database is HeidiSQL. On Jun 12, 3:28 pm, Wiwi <w...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Here is my code to update an attribute of one record: > > @person = Person.find($person_id) > > @person.update_attribute(:FIRST_NAME , "ANDY") > > It did not update the FRIST_NAME Bryan to ANDY in the database table, > but it did change in @person variable. > > Any idea??? > > Thanks,--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
bmunat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-12 22:12 UTC
Re: help needed on update_attributes
Is your first_name column in your db really all caps? This is not the Ruby/Rails convention by the way... all upper should be saved for constants. b On Jun 12, 10:41 am, Wiwi <w...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I forget that the database is HeidiSQL. > > On Jun 12, 3:28 pm, Wiwi <w...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > Here is my code to update an attribute of one record: > > > @person = Person.find($person_id) > > > @person.update_attribute(:FIRST_NAME , "ANDY") > > > It did not update the FRIST_NAME Bryan to ANDY in the database table, > > but it did change in @person variable. > > > Any idea??? > > > Thanks,--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---