1
2
3
4
5
6
7
8
9
10
11
  def index
    @items = Item.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @items }
    end


    @summ = @items.inject {|sum, item| sum + item.price }
  end