Sha256: 170a6b65f1aa0e3754e9da0eb98db8fd9aa5417feb939d69f613704319377b68
Contents?: true
Size: 597 Bytes
Versions: 9
Compression:
Stored size: 597 Bytes
Contents
module CabooseStore class ApplicationController < Caboose::ApplicationController protect_from_forgery layout 'layouts/caboose/application' before_filter :init_cart def init_cart return if session['cart_id'] && Order.exists?(session['cart_id']) order = Order.new(:status => 'cart', :date_created => DateTime.now) order.referring_site = request.env['HTTP_REFERER'] order.landing_page = request.fullpath order.landing_page_ref = params[:ref] if params[:ref] order.save session['cart_id'] = order.id; end end end
Version data entries
9 entries across 9 versions & 1 rubygems