How to display error messages in a multi-model form with transaction?

后端 未结 5 1311
长情又很酷
长情又很酷 2021-01-23 06:53

Two models, Organization and User, have a 1:many relationship. I have a combined signup form where an organization plus a user for that organization get signed up.

The p

5条回答
  •  無奈伤痛
    2021-01-23 07:30

    Try adding validates_associated :users under your has_many :users association in Organization.

    http://apidock.com/rails/ActiveModel/Validations/ClassMethods/validates_associated

提交回复
热议问题