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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/B3d8HeeRUusJ. For more options, visit https://groups.google.com/groups/opt_out.
Model.all(:order => ''first_name DESC, last_name DESC'') and then do the interpolation regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe <http://vizualize.me/loganathan> On Fri, Jan 18, 2013 at 4:43 PM, keerthi priya < emailtokeerthipriya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/B3d8HeeRUusJ. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Hi, Please do this : Client.order("first_name ASC, last_name ASC") On Fri, Jan 18, 2013 at 4:49 PM, Loganathan Sellapa <loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Model.all(:order => ''first_name DESC, last_name DESC'') and then do the interpolation > > > regards, > Loganathan > Mob: +91 7760780741 | +91 9944414388 > Skype: loganathan.sellappa > ViewMe <http://vizualize.me/loganathan> > > > > On Fri, Jan 18, 2013 at 4:43 PM, keerthi priya < > emailtokeerthipriya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> 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 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-talk/-/B3d8HeeRUusJ. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- Thanks & Regard Vikram Jain ============ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.