Skip to content

Instantly share code, notes, and snippets.

@underhilllabs
Created June 10, 2012 23:16
Show Gist options
  • Select an option

  • Save underhilllabs/2907655 to your computer and use it in GitHub Desktop.

Select an option

Save underhilllabs/2907655 to your computer and use it in GitHub Desktop.
get count of bookmarks tagged by each distinct tag
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