したがって、子条件を持つ Group オブジェクトがあります。Condition オブジェクトには、条件の自己参照型の子関連付けもあります。
グループ has_many :条件
条件の所属先:グループには_多くの条件:条件
レベルごとに明示的にリストする必要のない強力なパラメーターで複数のレベルを指定する良い方法はありますか (複数のレベルなどがある場合があります)。
@group_params ||= params.fetch(:group, {}).permit(
:name, conditions_attributes: [
:id, :operator, :value, :_destroy, conditions_attributes: [
:id, :operator, :value, :_destroy, conditions_attributes: ['etc']
]
]
)