When i get data from my db i use :order => "articles.title" but then i get them like Adam Bono Cecar anna How can i get the data like Adam anna Bono Cecar not get them case-sensitive. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Mikael, Mikael Björkegren wrote:> When i get data from my db i use :order => "articles.title"<snip>> How can i get the data like > > Adam > anna > Bono > Cecar >Have you tried "articles.title.downcase" ? I''m not sure if it will work inline in an order statement, but that''s what I''d try first. A second solution would be to add a separate column to your table with the field stored in that form to use in your finder. Best regards, Bill --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Jun 17, 2008 at 8:14 AM, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> > Hi Mikael, > > Mikael Björkegren wrote: > >> When i get data from my db i use :order => "articles.title" > <snip> >> How can i get the data like >> >> Adam >> anna >> Bono >> Cecar >> > > Have you tried "articles.title.downcase" ? I''m not sure if it will work > inline in an order statement, but that''s what I''d try first. A second > solution would be to add a separate column to your table with the field > stored in that form to use in your finder. > > Best regards, > Bill > >Well in SQL you''d want to `ORDER BY LOWER(title) ASC'', so give :order => "LOWER(articles.title) ASC" a try Jason --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks that worked perfect.> > Well in SQL you''d want to `ORDER BY LOWER(title) ASC'', so give :order > => "LOWER(articles.title) ASC" a try > > Jason-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---