title: Ruby on Rails - how to loop through object and reset values
body: <p>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.</p>
  
  <p>Here is my loop:</p>
  
  <pre><code>@dis.each do |d|
    temp = d.notes.inspect
  
    #Now check the length of the temp variable
    temp.length &gt; 25 ? temp = temp[0,25] :  nil
  
    d.notes = temp
  end
  </code></pre>
  
  <p>How do I change it so that the new values of temp get saved in the @dis object?</p>
  
  <p>Thanks!</p>