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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -