annotate .svn/pristine/4a/4acf53c4cc6bbba75432401fef2bc6a21f92b246.svn-base @ 1477:f2ad2199b49a bibplugin_integration

Close obsolete branch bibplugin_integration
author Chris Cannam
date Fri, 30 Nov 2012 14:41:31 +0000
parents cbb26bc654de
children
rev   line source
Chris@909 1 ActsAsList
Chris@909 2 ==========
Chris@909 3
Chris@909 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@909 5
Chris@909 6
Chris@909 7 Example
Chris@909 8 =======
Chris@909 9
Chris@909 10 class TodoList < ActiveRecord::Base
Chris@909 11 has_many :todo_items, :order => "position"
Chris@909 12 end
Chris@909 13
Chris@909 14 class TodoItem < ActiveRecord::Base
Chris@909 15 belongs_to :todo_list
Chris@909 16 acts_as_list :scope => :todo_list
Chris@909 17 end
Chris@909 18
Chris@909 19 todo_list.first.move_to_bottom
Chris@909 20 todo_list.last.move_higher
Chris@909 21
Chris@909 22
Chris@909 23 Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license