I have a model, resource, which has_many categories:
has_many :category_resources, :dependent => :destroy has_many :categories, :through => :category_resources
I have it setup to filter on categories, for a list view:
But I want it to still show all categories for a particular resource
listing, rather than just what was searched on.
eg, a resource, apple, has the categories, Food, Fruit, and Red.
If you select the resource Food, it should show:
Categories: [Food, Fruit, Red]
Instead, I’m just getting:
What would be the best way to structure my query for this to work?