Hello,
When i test this code
<h1>contenu de votre panier</h1>
<table>
<%
for item in @items
product = item.product
%>
<tr>
<td><%= item.quantity %></td>
<td><%= h(product.title)%></td>
<td align="right"><%=item.unit_price %></td>
<td align="right"><%=item.unit_price * item.quantity
%></td>
</tr>
<% end %>
</table>
I saw this message
NoMethodError in Store#display_cart
Showing app/views/store/display_cart.rhtml where line #5 raised:
undefined method `product'' for 5.0:Float
Extracted source (around line #5):
2: <table>
3: <%
4: for item in @items
5: product = item.product
6: %>
7: <tr>
8: <td><%= item.quantity %></td>
RAILS_ROOT:
/Users/bolomichelin/Documents/Creation_Perso/Developement
/depot/public/../config/..
But when i test this code, it''s working
<%= @items.size %>
Can u help me ?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060814/41a77657/attachment-0001.html