Ruby on Rails Sunday, March 31, 2013

On Sun, Mar 31, 2013 at 1:55 PM, Dmitrij B. <lists@ruby-forum.com> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment