4

rails 4, .

10 , :

#<User id: 29, email: "two@gmail.com", password_digest: "$2a$10$Ty2NOaVCsAK6sQwdQJHMgen9/fNkeDb.TmYY5Xyk/M5i...", fname: "bondalu2", lname: "two", created_at: "2014-08-22 06:09:46", updated_at: "2014-08-22 22:14:21", username: "bondalutwo", dob: "1950-01-01", zip: "32658", status: 1, image_id: 14, pref_age_low: 18, pref_age_high: 18, pref_radius: 5, pref_zip: 32658, token: "289c9d805697fa5dbec705c9574a7e2d">

      

new key "profile_img" and its value "abc.jpg" (diff for every user)

.

Like: #<User id: 29, email: "two@gmail.com", profile_img: "abc.jpg", password_digest:"...

      

, . .

+3




1


"profile_img"? , . , -, , "profile_img" .

:



 value = 'Some Value'
    @users.each{|user| user.update_attributes(:profile_img => value)}

      

0









All Articles