undefined method ' each_with_index'

Hi Bontina,

Bontina Chen wrote:

@bts = BT.find_by_product_id(@product.id)

<%=render :partial => "bt/bt", :collection => @bts %>

undefined method `each_with_index' for #<BT:0x45ed70c>

Just change the find to:

@bts = BT.find_all_by_product_id(@product.id)

Best regards,

What are you trying to do within the 'bt/bt' partial? What are you
trying to iterate over? If you simply want access to a BT object in
your partial you could try <%= render :partial => "bt/bt", :object =>
@bts %>