Displaying 1 result from an estimated 1 matches for "diplay_cart".
Did you mean:
display_cart
2006 Jun 23
3
Yet another problem with NoMethodError in Store#display_cart
...ass StoreController < ApplicationController
def index
@products = Product.salable_items
end
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
redirect_to(:action => ''display_cart'')
end
def diplay_cart
@cart = find_cart
@items = @cart.items
end
private
def find_cart
session[:cart] ||= Cart.new
end
end
<--- file store_controller.rb end here --->
<--- file application.rb begin here --->
class ApplicationController < ActionController::Base
model :cart...