I’m returning some rows from a tags database that look like this:
- apple banana pear
- banana melon
- apple peach lime
What I want to do with that data is use the .split method to divide them
into separate values in an array, then use the .uniq method to return a
unique list of the words like so:
apple, banana, pear, melon, peach, lime
So in my controller I have:
@tags = Tag.chop_em(params[:tag])
and in my model I know I need something:
I think I lack the understanding of how the array that comes back from
the database is constructed. Can anyone explain this so I can chop those
words up and sort them with the .uniq method?
Apologies if this is arse for elbow.