Make your models feel like they are in high school again. This plugin
retrieves the most frequently occurring values for each column. It
adds methods of the form most_popular_[pluralized_column_name]. Check
out
http://shanesbrain.net/articles/2006/08/04/acts-as-most-popular-rails-plugin
for sample usage.
The plugin is mostly just a group_by in disguise. It is probably
overkill if you just need to find the most popular items for one
column, and probably doesn’t warrant a plugin. But if you are a
newbie, then this plugin will do the heavy lifting for you.
Shane V.
http://shanesbrain.net