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 Vitarana http://shanesbrain.net
Love the name Shane! :) On 8/6/06, Shane Vitarana <shanev@gmail.com> wrote:> > 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 Vitarana > http://shanesbrain.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060806/38cc1b4e/attachment.html
I can''t take credit for the name. Someone on #rubyonrails came up with it. I couldn''t use Acts as Popular since it was already taken. If you are the one who came up with the name (and if you care) feel free to show yourself :) Shane On 8/6/06, Hammed Malik <hammed@gmail.com> wrote:> Love the name Shane! :) > > > On 8/6/06, Shane Vitarana <shanev@gmail.com> wrote: > > > 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 Vitarana > http://shanesbrain.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >