just want my first ten parts of the hash? how to chop it?

Depending on whether rating is an attribute or not, one of these should work:

   @temp = Articles.find(:all, :order => 'rating DESC', :limit => 10)

Or (assuming rating is numeric, note the negation):

   @temp = Articles.find(:all).sort_by {|article| - article.rating }.first(10)

And you aren't getting a 'hash' you're getting an Array from your Articles.find call.


Rob Biedenharn http://agileconsultingllc.com