0
0

【Rails】update_attributesが使用できない

Posted at

はじめに

Railsのアップデート中にupdate_attributesを使用している箇所でエラーが出たので、その対応をまとめます。

問題

以下のように、update_attributesを使用するとエラーが出ます。

@user.update_attributes(attributes)

解決方法

Rails6.1からupdate_attributesは使用できなくなりました。
代わりにupdateを使います。

@user.update(attributes)

参考

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