Ro Vent wrote:
Hello, i am very new to RoR and last 2 weeks i ve been reading a lot about them..
I have manage to create a quick application, but i am having problems figuring out how to sort the fields..
[code] def list @running = Boards.find_all("running = 1") @waiting = Boards.find_all("waiting = 1") @on_hold = Boards.find_all("running = 0", "waiting = 0") end [/code]
Thats what i have as the list def and it works but it order is as first in... I tried the following:
[code] def list @running = Boards.find(:all, :conditions => "running = 1", :order => priority ASC, quantity DESC') @waiting = Boards.find(:all, :conditions => "waiting = 1", :order => priority ASC, quantity DESC' @on_hold = Boards.(:all, :conditions => "running = 0, waiting = 0", :order => priority ASC, quantity DESC' end [/code]
And it gives me errors... I need to sort them with ASC priotity and DESC quantity (priority and quantity are columns on my table)
Any ideas...?
Thanks
It looks like you are missing quotes around your :order params.
Matthew Margolis blog.mattmargolis.net