From: Rahul Kumar Date: 2010-10-13T21:22:16+09:00 Subject: Re: sort_by: multiple fields with reverse sort Y. NOBUOKA wrote in post #949783: > The one way to do a reverse sort is wrapping a sort target in a class > for a reverse sort. > For instance: > Thanks, i will have to consider this. To the previous reply, > Are you sure the one criterium version works as you think? !x[1] returns a boolean value Frankly, i am not sure. i just tried it on irb. My issue is that i do not know how many columns a user will sort on, and what combination. So the normal sort() appears cumbersome, unless i can dynamically build a string and eval() it. Not sure i know how to do that. sort_by allows me to give a list as argument, so that appears suitable. -- Posted via http://www.ruby-forum.com/.