New topic Closed topic
avatar image
1
Filter collection based upon another collection with HABTM relation.
By Created , last editted

Hi,

I've got a Topic and a Tag model which have a 'has and belongs to many' relation.
Now I want to get a collection of Topics, which have a relation with (every item in) a Tag-collection.

I've tried the following:

Tags_col is a collection of Tags on which I want to filter.

So I want a collection of all topics which have relations with all the tags in var:tags_col.

The collection shown in the picture above, never holds any data at all, so that's not working

Should I solve this otherwise, or should Betty be able to do it like this?



Hi,

I've got a Topic and a Tag model which have a 'has and belongs to many' relation.
Now I want to get a collection of Topics, which have a relation with (every item in) a Tag-collection.

I've tried the following:

Tags_col is a collection of Tags on which I want to filter.

So I want a collection of all topics which have relations with all the tags in var:tags_col.

The collection shown in the picture above, never holds any data at all, so that's not working

Should I solve this otherwise, or should Betty be able to do it like this?


Answers
Sort by:

This topic is closed.