Your OrderItem model has not the belongs_to :line_items, but this is not the problem.
I can’t understand why method missing, because you have has_many :order_items…
For a HABTM (Has and Belongs To Many) I believe that you need to
change the names for tables and classes. It seems contentious, but to
my understanding it would be:
class Order
class Item
class ItemOrder
corresponding to:
table orders
table items
table items_orders
or, perhaps it's item_orders, or order_items for the table name. That
part seems contentious. Oh, I find "item" to be kinda vague as it
could be any kind of item. How about "dish", "entree" or "food"?