Just wondering if anyone with any experience with Shoppe know how to call an each method on product categories?
I'm trying to do something like this :
<% Shoppe::ProductCategory.each do |prod| %>
<li><%= prod.name %></li>
<% end %>
but I'm getting an undefined method error. Is there some special method that I'm missing? Shoppe::ProductCategory.all
and Shoppe::ProductCategory.first.name
both have no problems.
Thanks!
solved
Beautiful, @zoran, beautiful.
Try rewriting it to this instead:
You need to call
all
on theShoppe::ProductCategory
to be able to iterate over the collection.Hope it helps!