Ruby on Rails, two models in one form

后端 未结 5 1240
我在风中等你
我在风中等你 2021-01-31 05:57

I have two very similar models Pretreatment and Diagnosis, that belong to the model Patient:

class Pretreatment < ActiveRecord::Base
  belongs_to :patient
  a         


        
5条回答
  •  天命终不由人
    2021-01-31 06:19

    You can use fields_for for the second model, which works like form_for but doesn't generate the form tags. See the docs.

提交回复
热议问题