Making lists from acts_as_taggable
This took some time to figure out but I finally found a post on stack exchange. Even RailsCasts has a how-to on making a tag cloud, as well as act_as_taggable’s guthub page. But I just could not see how to limit to a context other than :tag
So maybe I was missing the obvious but all I wanted was to output a clickable list on a sidebar so users can filter content from that list.
The code took place in app/helpers/application_helper.rb Since I wanted to use it in a shared partial
You can see the gist here https://gist.github.com/alnutile/5745091
original post that lead me to this solution http://stackoverflow.com/questions/7169787/return-all-tags-based-on-context-actsastaggableon
I noticed too that the person who posted the solution just read the code! Sometimes it is too easy to google.
comments powered by Disqus