The bad method is configure all of your columns to sort by the real column (created_at for example) and id: config.columns[:created_at].sort_by :sql => 'created_at, id'
But this is not elegant. Need you set id column on all queries of your application? 2009/6/15 [email protected] <[email protected]> > > Hi, > > I work with MySql Cluster to have a high availability... > MySQL cluster has some constraints, like to always use the primary key > in the clause ORDER BY. > > Example : > If I have a table messages like : > - id integer autoincrement primary key > - created_at datetime > - updated_at datetime > - tile string > - content blod > > The requests must always be like that : > > - SELECT * FROM messages ORDER BY id > or > - SELECT * FROM messages ORDER BY updated_at, id > or > - SELECT * FROM messages WHEN title like 'A%' ORDER BY title, id > > Always the ID ;-)) > > How it's possible to implemente this with AS ? > the option Config.list.sorting = { :id => :asc } works only the first > time. > > If I click on the title column or updated_at column, how to include > too the ID column.. > > I looked columns[:updated_at].sort_by , but nothing on multiple > columns sorting.. > > Thanks for your help > > Vincent > > > -- Regards, Gabriel Sobrinho E-mail: [email protected] Phone: +55 31 8775 8378 Don't print this e-mail. The nature is thankful and your money also. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
