is it @cart have to put in :object ? @cart.item have to put in : collection ?
+3
A:
Using :collection
will run the partial once for every item in the array. While you're in the partial, the name of the object will be the name of the partial. So if you have:
<%= render :partial => 'cart', :collection => @carts %>
Then in your partial (_cart.html.erb, for example) you can use the cart
object:
Cart Name: <%= cart.name %>
Here's a link to the documentation:
Jaime Bellmyer
2010-10-21 05:10:53