Ruby on Rails Sunday, March 31, 2013

On Sun, Mar 31, 2013 at 1:55 PM, Dmitrij B. <> wrote:
i add curl --silent http://localhost:3000/products/3/who_bought -H
"Accept: application/xml"

According to that url you're going to action "who_bought" on "products_controller" 
and the problem is inside that action

<pre>undefined method `order&#x27; for #&lt;Product:0xb6196084&gt;</pre>

It seems you are doing Product.order, but your model says that you have a has_many relation with orders
so it should be Product.orders (maybe I'm wrong I'm not sure what's inside your "who_bought" action)

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
For more options, visit

No comments:

Post a Comment