Rails_admin: How to delete nested objects in rails 4?

人走茶凉 提交于 2019-12-24 13:10:35

问题


I am having:

class Entity < AR::Base
  has_many :representatives, 
    inverse_of: :entity, dependent: :destroy

  accepts_nested_attributes_for :representatives, 
    allow_destroy: true
end

and the Entity's rails admin form allows me to create nested representatives inline. Though, I am unable to remove representatives through the entity's nested form after they are already saved. I am suspicious that this is related with rails 4 since there are other similar questions with answers that do not work:

Rails Admin - removing a related object

来源:https://stackoverflow.com/questions/25727474/rails-admin-how-to-delete-nested-objects-in-rails-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!