def update
@manager = current_manager
if @manager.update(manager_params)
# Sign in the manager by passing validation in case their password changed
sign_in @manager, :bypass => true
redirect_to root_path
else
render "edit_password"
end
end
def completed
end
private
def manager_params
# NOTE: Using `strong_parameters` gem
params.require(:manager).permit(:password, :password_confirmation)
end
end
#1 楼 @yangman_wenzhu Unpermitted parameter: current_password
#4 楼 @luolinae86 搞定了,谢谢~!
#3 楼 @alucardpj 恩恩,抱歉,这样会比较好点~
#4 楼 @luolinae86 你好,这个已经修改了,可是单单这个修改不够啊~我参照了http://stackoverflow.com/questions/18026594/rails-4-devise-login-with-email-or-username-and-strong-parameters 这篇文章,可是还是出现了错误 undefined method `attr_accessible'
#17 楼 @ShiningRay 确定来?我也来!