我有如下關係:Rails的HABTM中間值
class Course < ActiveRecord::Base
attr_accessible :name
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
attr_accessible :name
has_and_belongs_to_many :courses
end
然後,我有如下表:
create_table :courses_users, :force => true, :id => false do |t|
t.integer :user_id
t.integer :course_id
t.integer :middle_value
end
如何訪問(編輯/更新)在許多人的中間值很多記錄?
謝謝,雖然我可以避免創建一個新的模型 – fxe