title: How to use :cart_id to find the current cart by session?
body: <p>I get totally confused when i read the book Agile web development with rails , Task D.</p>
  
  <p>I know the current_cart method in the base class can find the target cart by session. However, i don't know where the sysbol :card_id is from. </p>
  
  <p>When the lineItemController calls the current_cart method, what is the value of :cart_id?</p>
  
  <p>What's more, I have already run the common "rails generate scaffold line_item product_id:integer cart_id integer". What is the relationship between these two kinds of cart_id?</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    protect_from_forgery
  
    private
      def current_cart
         Cart.find(session[:cart_id])
      rescue ActiveRecord::RecordNotFound
         cart = Cart.create
         session[:cart_id] = cart.id
         cart
      end
  end
  </code></pre>