Created
June 10, 2012 23:16
-
-
Save underhilllabs/2907655 to your computer and use it in GitHub Desktop.
get count of bookmarks tagged by each distinct tag
This file contains hidden or 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 index | |
| # select name, count(1) from tags GROUP BY name; | |
| @tags = Tag.count(:all, :group => 'name', :order => 'count_all DESC') | |
| respond_with @tags | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment