Ruby on Rails, two models in one form

后端 未结 5 1201
我在风中等你
我在风中等你 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:20

    There are some gems available for nested forms. one of them is awesome_nested_fields. I haven't used this earlier but that shows good code in documentation. Another one is simple_form.

    Hope that helps!!!

提交回复
热议问题