to_model delegated to attachment, but attachment is nil

前端 未结 2 1372
囚心锁ツ
囚心锁ツ 2021-01-28 10:47

So I asked this question already here: previous question and didn\'t get much help, I looked for other questions similar to mine, but no resolution. So I\'ll ask the question ag

2条回答
  •  不要未来只要你来
    2021-01-28 11:14

    ISSUE RESOLVED:

      # If you have extra params to permit, append them to the sanitizer.
      def configure_sign_up_params
        devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname, :image])
      end
    
      # If you have extra params to permit, append them to the sanitizer.
      def configure_account_update_params
        devise_parameter_sanitizer.permit(:account_update, keys: [:firstname, :image])
      end
    

    so the configure_account_update_params defenition was set to permit the :signup not :account_update. I changed it to :account_update and it worked!

提交回复
热议问题