ruby - Is there a better way to do it? ( Mongoid + TaggableWithContext ) -
is few days i'm trying learn how use mongoid , found myself faced problem:
there better way this?
group.find_by(name: params[:group]).subgroups.tags.each |l| puts l puts group.find_by(params[:group]).subgroups.tags_tagged_with(l).to_a end
i'm using mongoid in combo mongoid_taggable_with_context
the idea find tags belonging group, , each of these items tag.
expected result (example):
tag1:
subgroup2
subgroup3
tag2:
subgroup1
subgroup2
etc.
thanks patience
Comments
Post a Comment