我將我的Rails從3.2遷移到Rails 4.2.6。我有2個表,其中報告:has_many =>圖標。我爲report和icon_attributes添加了強大的參數。創建功能工作正常,並且在更新功能時,我能夠更新報告但無法更新圖標,而是每次點擊更新操作時都會創建新圖標。 這是我的代碼: report.rb: class Report < ActiveRecord::Base
has
我很難試圖瞭解如何允許非模型參數。 我讀過: Rails Strong Parameters: How to accept both model and non-model attributes? Rails 4 Strong parameters : permit all attributes? Strong Parameters 所以,對於一個 「正常」 的情況 - 讓我們說,我有一個具有隻是
這些問題的標題非常詳細地描述了我需要做的事情。它基本上是一樣的這個問題,從未收到答覆: Rails 4: get list of permitted attributes (strong parameters) from a controller 在這個問題提供的例子類似,這將是等效於這樣的事情,如果它存在: account_update_permitted_params = AccountCon