I am looping through a list of objects and changing some of the values. When I output the value into the logger, I see the changed values, but when then on the resulting page, the changes do not get saved.
Here is my loop:
@dis.each do |d|
temp = d.notes.inspect
#Now check the length of the temp variable
temp.length > 25 ? temp = temp[0,25] : nil
d.notes = temp
end
How do I change it so that the new values of temp get saved in the @dis object?
Thanks!
https://stackoverflow.com/a/5646754/643500
Edit:
So for your code it will look like
Edit:
Full code that worked here. Make sure you have :notes with getters and setters. Read about cattr_accessor, attr_accessor and attr_accessible