Resetting position attribute when using acts_as_list gem? (Rails)
问题 I have a simple Rails 3 app where a Goal has many Objectives. In my views, I allow the user to-reorder the Objectives for any given Goal, and I am using the acts_as_list gem to achieve some of this functionality. Goal model: class Goal < ActiveRecord::Base attr_accessible :name, :description has_many :objectives, :order => :position, :dependent => :destroy end Objective model: class Objective < ActiveRecord::Base attr_accessible :name, :description, :position belongs_to :goal acts_as_list