Ok i have two models:
好的,我有两个型号:
class Treatment < ActiveRecord::Base
attr_accessible :category_id, :content, :date, :patient_id
has_one :category
end
class Category < ActiveRecord::Base
attr_accessible :text
has_many :treatments
end
class TreaOk i have two models:
好的,我有两个型号:
class Treatment < ActiveRecord::Base
attr_accessible :category_id, :content, :date, :patient_id
has_one :category
end
class Category < ActiveRecord::Base
attr_accessible :text
has_many :treatments
end
class Trea