Rails hashes with unknown keys and strong parameters

前端 未结 4 1510
旧巷少年郎
旧巷少年郎 2021-01-12 20:09

I have a rails application that stores a serialized hash in a field called properties.

The hashes keys are unknown though, so I don\'t know of a way to

4条回答
  •  旧巷少年郎
    2021-01-12 20:42

    Your need is completely opposite of objective of strong parameter, when we define strong parameter then basically we are going to whitelist the coming params.

    and here in your case we exactly don't know the keys, so there is no need to put strong parameter check over there. that will solve your problem.

提交回复
热议问题