Displaying 1 result from an estimated 1 matches for "activity_cryst".
2007 May 22
3
can I use acts_as_list with a has_many :through association
...nit_activities
end
class UnitActivity < ActiveRecord::Base
belongs_to :activity
belongs_to :unit
acts_as_list :scope => :unit_id
end
In he example below in script/console I load in some previously
created activities; make a new unit; and add the activities to the
unit.
>> activity_crystals = Activity.find_by_name("Molecular crystals")
>> activity_browning = Activity.find_by_name("Brownian motion")
>> activity_mixing = Activity.find_by_name("Temperature of mixing
>>water - TEEMSS demo")
>> my_unit = Unit.create(:name => &...