0
私は現在、レガシーデータベースを使用しています。サブミッションとパブリケーションという2つのモデルがあります。私は新しい投稿を作成する際Ruby on Rails - has_and_belongs_to_many relationship
class Submission < ActiveRecord::Base
has_and_belongs_to_many :publications, :join_table => "ish_sub_pub", :association_foreign_key => "SLN_PUB_FK"
end
class Publication < ActiveRecord::Base
has_and_belongs_to_many :submissions, :join_table => "ish_sub_pub" ,
:association_foreign_key => "SLN_SUBMISSION_FK"
end
は、私はそれにパブリケーションを関連付けることができるようにしたいと、このために私が参加し、テーブル「ish_sub_pub」に新しいレコードを追加する必要があります。
投稿に投稿を追加する方法について少し混乱します。あなたの助けのための
どうもありがとう