No. This doesn’t look like it should work. I’d really recommend
reading up on Ruby a bit. @my_cart_items would appear to be a
collection (an array). Using “for” you are iterating over that list
but you are not using the individual item yielded by the iterator. So,
perhaps what you wanted was:
for shopping_cart_item in @my_cart_items do |item|
# do stuff…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.