I have a searches table, which has all the searches that get run on our site. I want to pull up the most popular searches. Like say there are 130 records with the column of phrase being "cheese", how do I sort the results by count and return them in order of most to least using active record?
I have a searches table, which has all the searches that get run on
Share
Taken from the example I linked in the comments above.
Although I just tried this on my own sqlite db and it worked fine (rails 3)