I’ve got a data structure (matrix) like the following :
ruby-1.9.2-p290 :060 > current_user.watchlists.map{|l|l.tags_array}
=> [[], [], ["tag1", "tag2", "tag3"], [], [], ["tag2", "tag3"], [], [], ["tag4"], []]
ruby-1.9.2-p290 :061 >
I want to traverse the structure to get a result like this:
"tag1" "tag2" "tag3" "tag4"
How can I do it ?
Even better, if you can, make
User has_many :tags, :trough => :watchlistsand then: