Skip to content

Instantly share code, notes, and snippets.

@cleishm
Created September 21, 2011 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleishm/1231545 to your computer and use it in GitHub Desktop.
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)
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