title: 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path
body: <p>When I attempt to view any page, I get the error above.</p>
  
  <p>Here's my layouts/application.html.erb code:</p>
  
  <pre><code>&lt;body&gt;
  &lt;%= link_to "Store Front", root_path, id: "logo" %&gt;
    &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;aside class="span4"&gt;
          &lt;/aside&gt; 
      &lt;/div&gt;
      &lt;%= yield %&gt;
      &lt;%= render 'layouts/header' %&gt;
      &lt;div class="container"&gt;
        &lt;div class="row"&gt;
          &lt;div class="span8"&gt;
            &lt;%= yield %&gt;
          &lt;/div&gt;
          &lt;aside class="span4"&gt;
            &lt;%= render @cart %&gt;
          &lt;/aside&gt;  
        &lt;%= render 'layouts/footer' %&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>the problem is causing by &lt;%= render @cart %>.</p>
  
  <p>Here's my application_controller :</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    # Prevent CSRF attacks by raising an exception.
    # For APIs, you may want to use :null_session instead.
    protect_from_forgery with: :exception
    include SessionsHelper
    helper_method :current_order
  
    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>
  
  <p>any idea ? </p>