title: Can't understand how to sum items price in RoR
body: <p>Hello I want to make simple shopping cart.
  I am a  beginner in programming. So please help.
  I have items with prices and i want to sum up them (quantity equals to one). </p>
  
  <p>veiw </p>
  
  <p><code>&lt;h1&gt;Summ:&lt;%= @items.total %&gt;&lt;/h1&gt;</code></p>
  
  <p>model</p>
  
  <pre><code>class Item &lt; ActiveRecord::Base
  
    def total
        summ = 0
        @items.each do |item|
            summ += item.price
        end
    end
  
  end
  </code></pre>
  
  <p>What is wrong. I have this error NoMethodError in Items#index</p>