order from db

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.

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

Thanks that worked perfect.