2019-10-31から1日間の記事一覧

Rails ユーザーのパスワードを保存するモデルクラス を作成する

Gemfileのbcryptのコメントを外します。 gem 'bcrypt', '~> 3.1.7' bcryptをインストールします。 $ bundle install Userモデルクラスを作成します。 $ bin/rails g model users Userモデルクラスに、has_secure_password を追加します。 class User < Appli…