Order by with first_name and also last_name

Hi all,

hey I have need some info

i have this

def fullname

“#{first_name} #{last_name}”

end

and i want alphabetical order with first name i can do it but along with first_name i want last_name in alphabetical order

like
James emi will come first before James fame
can we do in rails

Cheers,
Kp

Model.all(:order => 'first_name DESC, last_name DESC') and then do the interpolation

Hi,

Please do this :

Client.order(``"first_name ASC, last_name ASC"``)