0
0

More than 1 year has passed since last update.

souceryを使った新規登録ができない

Posted at

今回の記事はあまり役立つものではないが一応記録として残しておく
新規登録をする際にこのエラー文が出ていた

NoMethodError in UsersController#create
undefined method `crypted_password=' for #<User id: nil, email: "r@a", password_digest: nil, salt: "ykCB6gjaxMiesGxRoC3B", first_name: "あ", last_name: "あ">
Did you mean?
encrypt_password
Extracted source (around line #9):

これに苦しんでいたわけだが有料chatGPTに登録して使ってみるとものの30分で解決してしまった

直した点は
・usersコントローラーの

def user_params
        params.require(:user).permit(:email, :password, :password_confirmation,:last_name,:first_name)
    end

にcrypted_passwordを追加した(カラムをcrypted_passwordにしたときは一緒に変更していた)

・Userテーブルのカラムをpassword_digestからcrypted_passwordに変更した
 (何度も変更していたのになぜ解決しなかったかはわからない)

要するに技術的なことは何もわかっていない

この件で学んだこと
・chatGPTは絶対に課金するべきだということ
・人間のアドバイスは必ず当たっているわけではないこと

有料chatGPTと結婚したいレベルで惚れた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0