2009/11/12 Newb Newb <[email protected]>: > > Colin Law wrote: >> 2009/11/12 Newb Newb <[email protected]>: >>> >>> else >>> >>> puts @newsinfo.errors.inspect >>> >>> end >>> >>> the control goes to if condition only.no validation errors >> >> Do you mean it goes to to the else condition but shows no errors? Or >> do you mean it passes the if test but the data is not updated in the >> db? >> >> Colin > > Thanks for the reply... > it goes to the if statement only but not updating the records... > > Processing NewsController#modify (for 192.168.0.82 at 2009-11-12 > 14:25:40) [POST] > Parameters: {"commit"=>"Edit", "id"=>"1", > "newsinfo"=>{"newstext"=>"revafgtfggfffrtyhrthfgjh"}} > [4;36;1mSQL (0.0ms) [0m [0;1mSET SQL_AUTO_IS_NULL=0 [0m > ::: Checking session expiry > ::: Session has not expired. Reinitialising. > ::: Initializing session expiry. Expires at Thu Nov 12 16:05:40 +0530 > 2009 > [4;35;1mUserInfo Columns (15.0ms) [0m [0mSHOW FIELDS FROM > `userinfo` [0m > [4;36;1mUserInfo Load (0.0ms) [0m [0;1mSELECT * FROM `userinfo` > WHERE (`userinfo`.`id` IS NULL) LIMIT 1 [0m > [4;35;1mNews Columns (16.0ms) [0m [0mSHOW FIELDS FROM `news` [0m > [4;36;1mNews Load (0.0ms) [0m [0;1mSELECT * FROM `news` WHERE > (`news`.`id` = 1) [0m > [4;35;1mSQL (0.0ms) [0m [0mBEGIN [0m > [4;36;1mSQL (0.0ms) [0m [0;1mCOMMIT [0m
There should be an UPDATE here, so for some reason rails is not changing the record. Are you absolutely sure that the field newstext has not already got the value revafgtfggfffrtyhrthfgjh? Have a look in phpmyadmin or whatever tool you use to look at the db and check. Otherwise please post the complete code for NewsController#modify. Colin > Redirected to actionlistcontrollernews > Completed in 63ms (DB: 31) | 302 Found > [http://192.168.0.82/news/modify/1] > > this is the log when i modify my news. > > it has only one field .the field is newstext. > > still its not getting updated. > > Any Ideas > > -- > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

