Nested Attributes - restrict_with_error if nested has associations

后端 未结 0 1888
春和景丽
春和景丽 2021-02-06 03:44

So I want to allow_destroy nested attributes ONLY if they have no associations. How can it be accomplished?

EXAMPLE:

course.rb

  has_many :enrollmen         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题