If I were you I would add a new column PLAIN_NAME or similar and I
would strip everything out everything you don't want in the name and
then sort by it. I think it would remove the complexity. You can
populate the new column with a before_save callback.
On Jun 10, 10:59 am, Runa wrote:
> While so
On 11 June 2011 07:10, Runa wrote:
> Thanks Walter and Kendall.
>
> But ouput which I get using sort mentioned is as follows
>
>>> a = [ "A Sharma", "A. Zah", "Aarti Jain", "A. Bansal", "Bindu Lakra" ]
> => ["A Sharma", "A. Zah", "Aarti Jain", "A. Bansal", "Bindu Lakra"]
>>> a.sort {|x,y| y <=> x
Thanks Walter and Kendall.
But ouput which I get using sort mentioned is as follows
>> a = [ "A Sharma", "A. Zah", "Aarti Jain", "A. Bansal", "Bindu Lakra" ]
=> ["A Sharma", "A. Zah", "Aarti Jain", "A. Bansal", "Bindu Lakra"]
>> a.sort {|x,y| y <=> x}
=> ["Bindu Lakra", "Aarti Jain", "A. Zah", "
3 matches
Mail list logo