Sha256: 00587b471ddd346e15a3a096f2a77d58cc4362ca36a880944540797a4ca55f3b
Contents?: true
Size: 813 Bytes
Versions: 96
Compression:
Stored size: 813 Bytes
Contents
module Piggybak class CartController < ApplicationController def show @cart = Cart.new(cookies["cart"]) @cart.update_quantities cookies["cart"] = { :value => @cart.to_cookie, :path => '/' } end def add cookies["cart"] = { :value => Cart.add(cookies["cart"], params), :path => '/' } redirect_to piggybak.cart_url end def remove response.set_cookie("cart", { :value => Cart.remove(cookies["cart"], params[:item]), :path => '/' }) redirect_to piggybak.cart_url end def clear cookies["cart"] = { :value => '', :path => '/' } redirect_to piggybak.cart_url end def update cookies["cart"] = { :value => Cart.update(cookies["cart"], params), :path => '/' } redirect_to piggybak.cart_url end end end
Version data entries
96 entries across 96 versions & 1 rubygems