But, my local variable 'product' is defined!!

Following a tutorial here and I had it pointed out to me that it may be
a slightly older version (Agile web development v2) so I'm hoping my
problem is just sytax that one of the gurus here can point out...

When posting something like this, it's always a good idea to
mention the version of Rails you're using :slight_smile: but...

I have a view called store/index.rhtml; it looks like this -

<% for products in @products -%>
<div class="entry">
<%= image_tag(product.image_url) %>

It should just list some sample product data. But it tells me:

undefined local variable or method `product' for

As it should -- where do you see the variable 'product' defined in
the above code?

You can fix by changing to `for product in @products` which also
reads properly -- one 'product' from a collection of '@products'.