Skip to content

Instantly share code, notes, and snippets.

@danneu
Created February 6, 2012 06:20
Show Gist options
  • Save danneu/1750191 to your computer and use it in GitHub Desktop.
Save danneu/1750191 to your computer and use it in GitHub Desktop.
# Better way to write this?
module TopicsHelper
def tags_for(topic)
tags = ""
topic.tags.each do |tag|
tags << content_tag(:span, tag.name)
end
tags.html_safe
end
end
#View=> <span>Tag One</span><span>Tag Two</span><span>Tag Three</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment