标题说明了一切,基本上我面对的是same problem as here,但我使用的是ActiveAdmin,我无法解决这个问题。
我试过添加:
controller do
def update
if current_account.update_with_password(params[:account])
sign_in(current_account, :bypass => true)
flash[:notice] = 'Password updated.'
redirect_to account_path
else
render :action => :show
end
end
end
在ActiveAdmin注册页面中,但没有工作。
我发现的其他解决方案是在设计配置文件中设置config.sign_in_after_reset_password = true
,但我没有在初始化器中看到任何devise.rb
文件。我还在self.sign_in_after_reset_password = true
模型文件中绑了admin_user.rb
,但没有用。
我认为你的设计配置是在config
目录中的某个地方。如果你没有罚款,请在initializers/devise.rb
中添加以下行。
Devise.setup do |config|
config.sign_in_after_reset_password = true
end