undefined method `empty?' for nil:NilClass
phuong3030 opened this issue · comments
Phương Trần Tuấn commented
Hello everyone,
I got this error 'undefined method `empty?' for nil:NilClass' when I install spree related products 3-0-stable to spree 3.0.4. Can you please help me to resolve the error? Thank you.
Showing /home/phuong3030/.rvm/gems/ruby-2.2.3@eshop/bundler/gems/spree_related_products-a265c6ee7418/app/views/spree/admin/products/related.html.erb where line #6 raised:
undefined method `empty?' for nil:NilClass
Extracted source (around line #6):
<%= csrf_meta_tag %>
<% if @relation_types.empty? %>
<div class="alert alert-warning no-objects-found">
<%= Spree.t(:no_relation_types) %>
</div>
Phương Trần Tuấn commented
I changed it back to old versions.
Spree::Admin::ProductsController.class_eval do
def related
load_resource
@relation_types = Spree::Product.relation_types
end
end
Wooobee commented
I get the same error can you elaborate what you did to fix it.
Thanks Manuel!
Ahmad commented
+1 I got the same error