LoginSignup
9
3

More than 5 years have passed since last update.

RubyonRailsのDeviseでユーザー情報うをパスワードなしで更新するときにハマった話

Last updated at Posted at 2017-06-29

以下の通り書いたのだけれどね、Railsくん
unknown attribute 'current_password'
と、オッシャイマスノ。

\app\controllers\users\registrations_controller.rb
  def update_resource(resource, params)
    resource.update_without_password(params)
  end

原因は、以下の記入漏れでした。

\app\models\user.rb
attr_accessor :current_password

これで、パスワードの入力なしに、ユーザー情報を更新することができました。

9
3
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
9
3