使用Rails 4,設計,簡單的形式。讀了很多關於這個,但肯定沒有足夠的經驗。我做了RegistrationController,自定義視圖也存在。 有了這個,我有密碼確認沒有問題,但我所有的PARAMS是不允許的:在沒有密碼確認的情況下設計更新附加屬性。
def update_resource(resource, params)
resource.update_without_password(params)
end
據我所知,這應該是決定,但對我沒有任何影響:
def configure_account_update_params
devise_parameter_sanitizer.for(:account_update) do |u|
u.permit(:username, :first_name, :last_name, :price_plan_id, :email_notify, :msg_notify,
:email, :password, :password_confirmation, :current_password)
end
end
也許有人能寫出關於它的整個概念性答案嗎?
你在註冊控制器中放了before_filter:configure_permitted_parameters嗎? –
@DileepNandanam這個任務迭代太多了。你是對的,在這裏我忘了說。非常感謝,一切正常。在我的情況下,回調函數是'before_filter:configure_account_update_params,只有:[:update]'隨意寫答案,我會接受它。 – nobilik