app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def current_cart
    @current_cart ||= Hash.new(0).merge(
      Hash(session[:cart]).delete_if { |k, v| k.blank? || v.blank? }
    )
  end
def current_cart @current_cart ||= Hash . new ( 0 ) . merge ( Hash ( session [ :cart ] ) . delete_if { | k , v | k . blank? || v . blank? } ) end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .