I have the an error such as undefined method ‘each’
pls can any one find the error from the code given below
<%@usercart=Usrecart.find_by_user_id(@b)%>
Typo much? Shouldn’t that be Usercart…
On Tue, Mar 11, 2008 at 10:19 PM, sharan [email protected]
wrote:
<br>
<%end%>
>
<%=link_to “ADD NEW ITEM”,:action=>‘index’,:id=>@usercart.user_id%>
–
seth at subimage interactive
http://sublog.subimage.com
Cashboard - Estimates, invoices, and time tracking software - for free!
http://www.getcashboard.com
Substruct - Open source RoR e-commerce software.
http://code.google.com/p/substruct/
On 12 Mar 2008, at 05:19, sharan wrote:
I have the an error such as undefined method ‘each’
pls can any one find the error from the code given below
It looks like you’re half expecting @usercart to be an array since
you’re trying to iterate over it, but it isn’t.
Fred
@usercart=Usrecart.find_all_by_user_id(@b)
note the all in the find method
On 12 Mrz., 08:41, Frederick C. [email protected]