Displaying 1 result from an estimated 1 matches for "chopem".
Did you mean:
chop_em
2006 Mar 24
2
Return all rows, split then show uniques
...od 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:
def taglist
@tags = Tag.chop_em(params[:tag])
end
and in my model I know I need something:
def self.chopem(tag)
Tag.find(:all)
end
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.
--
Posted via http://www.ruby-forum.com...