The route should be created in the `resources` call you mentioned earlier as described in the Rails Guide. Try running `rails routes` in the console to check that the route was defined correctly. Might be useful to post some code if you're still having trouble.
I'm trying to set up a :through association where the through model is polymorphic. Multiple pairs of models can thus be associated through this one table. Here's what I have so far: https://www.pastery.net/pvvraj/ . I'm trying to set up an association to be able to use `shopping_list.items`, but I can't figure out how to tell it to get the item id from `"references"."left_id"` (instead of the
right, the database fields don't match the model names. So I should be using something like `has_many :items, as: :left`?
Ah that explains it. So `Reference` should have a `belongs_to :item, foreign_key: :left_id` ?
Normally I would, but in this case the association table needs to support multiple types of associations.
Hrm, still having trouble. When I run `ShoppingList.first.items`, it tries to run this SQL: `SELECT "items".* FROM "items" INNER JOIN "references" ON "items"."id" = "references"."referenceable_id" WHERE "references"."right_id" = $1 AND "references"."referenceable_type" = $2`