Created
September 21, 2011 08:18
-
-
Save cleishm/1231545 to your computer and use it in GitHub Desktop.
Assigning an array of tags or a comma separated list of tags (or a combination)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tags=(tags) | |
@tags = [ tags ].flatten.flat_map {|k| k.split(',')}.map(&:strip).uniq | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment