1
如何使用強大的參數PARAMS這樣的:強大的參數屬性
{
... attributes of a model,
related_model_attributes => [
RANDOM_HASH_KEY => { attr_1 => value_1, ... other attributes },
ANOTHER_RANDOM_KEY => { attr_1 => value_1, ... other attributes}
...
]
}
如果我使用普通許可證的風格像FF片段:
permit!(... model attributes, related_model_attributes: [{:attr_1, ..other attributes]])
它會在隨機哈希鍵上拋出和不允許的錯誤。
我如何與has_many一起使用強參數?
你有沒有得到這個工作? – JoshL
是的 - 這種方法的工作原理 - 儘管我最近一直在使用JSON模式來獲得更強大的解決方案。 – prater