title: How to add new attribute to ActiveRecord
body: <p>After getting all values from model, I want to add another custom attribute to the ActiveRecord class (this attribute is not a column in db) so that I could use it in view, but rails does not allow me to add one. What should I add in its model class?</p>
  
  <pre><code>@test.all
  
  @test.each do |elm|
      elm[:newatt] = 'added string'
  end
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>can't write unknown attribute `newatt'
  </code></pre>