[Rails] "Undefined method" problem in "Agile Web Development With Rails"

Emil Gustafsson emil at classicbildelar.com
Sun Mar 5 20:33:04 GMT 2006


Hi,

I'm reading the "Agile Web Development With Rails" book. So long,  
everything has worked fine, but now I got this annoying error message  
that I just can't understand. The error appears for me around page  
87, chapter 8.

NoMethodError in Store#display_cart

Showing app/views/store/display_cart.rhtml where line #28 raised:

undefined method `product' for 2395.0:Float


Extracted source (around line #28):

25: </tr>
26: <%
27: for item in @items
28: 	product = item.product
29: -%>
30: <tr>
31: 	<td><%= h(product.title) %></td>


I'm sure my source code is correct.

//Emil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060305/7062e320/attachment-0001.html


More information about the Rails mailing list