# problem with through.

**URL:** <https://discuss.rubyonrails.org/t/problem-with-through/15312>\
**Category:** rubyonrails-talk\
**Created:** [July 5, 2007, 1:03pm UTC](https://discuss.rubyonrails.org/t/problem-with-through/15312 "2007-07-05T13:03:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michau](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@michau](https://discuss.rubyonrails.org/u/michau)\
**Post date:** [July 5, 2007, 1:03pm UTC](https://discuss.rubyonrails.org/t/problem-with-through/15312/1 "2007-07-05T13:03:52Z")

</div>

Has anyone ever had problems with :through relationship? I have set it properly, according to the book, but getting response from the browser

"Could not find the association :line\_items in model Product"

and the relationship set in Product model is: has\_many :orders, :through =\> :line\_items

Order model looks like: has\_many :line\_items

and LineItem belongs\_to :product belongs\_to :order

I want to find orders which contain product with an id = 3 I am doing it through a method

def who\_bought @product = Product.find(params[:id]) @orders = @product.orders end

and then I have an rxml template to iterate over the orders and print them onto the screen. Help please!

---

<div class="post-metadata">

**Author:** ![michau](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@michau](https://discuss.rubyonrails.org/u/michau)\
**Post date:** [July 6, 2007, 1:22pm UTC](https://discuss.rubyonrails.org/t/problem-with-through/15312/2 "2007-07-06T13:22:47Z")

</div>

Wow, thanks, that helped. Im totally new in RoR and as much as it's all features seems to be helpful, they're also confusing sometimes.

Cheers
