0
我使用施普雷一個電子商務應用程序,我想驗證SKU施普雷驗證領域
Spree::Variant.class_eval do
attr_accessible :sku
validates_uniqueness_of :sku
end
那麼的獨特性,當我想創造一個新的紀錄我得到這個錯誤:
undefined method `price' for nil:NilClass
Extracted source (around line #7):
4: <% content_for :sidebar do %>
5:
6: <h3>
7: <%= @product.name %><span class="sku"><%= @product.sku %></span>
8: </h3>
9: <br class="clear"><ul class="sidebar product-menu" data-hook="admin_product_tabs">
10: <li <%== ' class="active"' if current == 'Product Details' %>>