ActiveRecord::StatementInvalid in Products#index

Showing /Users/lvchengbo/jdstore/app/views/common/_navbar.html.erb where line #18 raised:

SQLite3::SQLException: no such column: cart_items.cart_id: SELECT COUNT(*) FROM "products" INNER JOIN "cart_items" ON "products"."id" = "cart_items"."product_id" WHERE "cart_items"."cart_id" = ?

Extracted source (around line **#18**):
161718192021 

<li>
<%= link_to "#" do %>
購物車 <i class="fa fa-shopping-cart"> </i> ( <%= current_cart.products.count %> )
<% end %>
</li>
<% if !current_user %>

Trace of template inclusion: app/views/layouts/application.html.erb
Rails.root: /Users/lvchengbo/jdstore

Application Trace | Framework Trace | Full Traceapp/views/common/_navbar.html.erb:18:in block in _app_views_common__navbar_html_erb__861366649695980850_70202464562160'](http://localhost:3000/#)[app/views/common/_navbar.html.erb:17:in_app_views_common__navbar_html_erb__861366649695980850_70202464562160'app/views/layouts/application.html.erb:14:in `_app_views_layouts_application_html_erb___3704095119421627845_70202528987540'

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容