presumably because @product is a string containing a product id, rather than an instance of Product.
Fred
presumably because @product is a string containing a product id, rather than an instance of Product.
Fred
Frederick Cheung wrote:
But the above code is throwing error:
ActiveRecord::AssociationTypeMismatch in StoreController#update
Product expected, got String
presumably because @product is a string containing a product id, rather than an instance of Product.
Fred
yeah I got that. Can you tell me what is the way to implement it?
Well you say you've got it, but you're just not doing it.
def update @quantity = request.parameters[:quantity] @product = request.parameters[:productid]
you're just setting @product to a string rather than using Product.find
Fred
Ruchita, I guess you might find rails irc channel a lot more useful than this mailing list, as it's real time.
Try http://www.mirc.com/ Server : irc.freenode.net Channel : #rubyonrails