annotate lib/plugins/acts_as_list/README @ 1327:287f201c2802 redmine-2.2-integration

Add italic
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 19 Jun 2013 20:56:22 +0100
parents 433d4f72a19b
children
rev   line source
Chris@0 1 ActsAsList
Chris@0 2 ==========
Chris@0 3
Chris@0 4 This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a +position+ column defined as an integer on the mapped database table.
Chris@0 5
Chris@0 6
Chris@0 7 Example
Chris@0 8 =======
Chris@0 9
Chris@0 10 class TodoList < ActiveRecord::Base
Chris@0 11 has_many :todo_items, :order => "position"
Chris@0 12 end
Chris@0 13
Chris@0 14 class TodoItem < ActiveRecord::Base
Chris@0 15 belongs_to :todo_list
Chris@0 16 acts_as_list :scope => :todo_list
Chris@0 17 end
Chris@0 18
Chris@0 19 todo_list.first.move_to_bottom
Chris@0 20 todo_list.last.move_higher
Chris@0 21
Chris@0 22
Chris@0 23 Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license