私はこのように接続されている3つのモデルを持っています:
class Appointment < ActiveRecord::Base
has_many :service_items
has_many :services, through: :service_items
accepts_nested_attributes_for :service_items
end
class ServiceItem < ActiveRecord::Base
belongs_to :appointment
belongs_to :service
end
class Service < ActiveRecord::Base
has_many :service_items
end
新しい予約フォームでは、利用可能なサービスごとにチェックのリストが必要です。新しい予定のサービス項目は、選択したボックスから作成する必要があります。
このようなフォームを作成するにはどうすればよいですか?