This is a beginner's question but for some reason I cannot find the answer elsewhere.

```
Customer has_many orders  
Order has_many order_items

```

I am in customer/show.html.erb and I want my customer to manipulate order\_items.

Many orders have many order\_items and I want to search ALL of those order\_items to find those such that read == false.

```
#controller
@customer = Customer.find(params[:id])
@orders = @customer.orders

```

@order\_items = @orders.order\_items doesn't work. Given that I have multiple items in @orders, how can I collect all the order\_items that belong to @orders?

=== EDIT ===

My entire database structure is a big complicated group of tables and I need to traverse that tree for this particular view. 

```
customer has_many orders
orders has_many order_items
order_items belongs_to category

```

How do I, for example, find the number of my customer's order\_items that belong to category X?

Last question: why doesn't @orders.find\_all\_by\_x(...) work?