I'm using acts_as_list plugin to sort my to do lists.
* [drag] Test 1
* [drag] sadf 2
* [drag] asdf 3
However I want the numbering to the DESC instead. So it shows as
* [drag] Test 3
* [drag] sadf 2
* [drag] asdf 1
How do I do that?
Thanks
I'm using acts_as_list plugin to sort my to do lists.
* [drag] Test 1
* [drag] sadf 2
* [drag] asdf 3
However I want the numbering to the DESC instead. So it shows as
* [drag] Test 3
* [drag] sadf 2
* [drag] asdf 1
How do I do that?
Thanks
Try changing the order in the model:
class TodoList < ActiveRecord::Base
has_many :todo_items, :order => "position DESC"
end
That should produce:
assuming your items are:
id name position
1 Test 1
2 sadf 2
3 asdf 3