class PasswordsController < ApplicationController
def edit
end
def update
if current_user.update_with_password(user_params.merge(pw_changed: "true"))
flash[:notice] = 'Your Password Has Been Sucessfully Updated.'
redirect_to authenticated_root_path
else
flash[:error] = 'Oh No! Something Went Wrong, Please Try Again.'
render :edit
end
end
private
def user_params
param_key = current_user.class.model_name.param_key
params.require(param_key)
.permit(:current_password, :password, :password_confirmation)
end
end
我已将电子邮件意图插入到我的活动中,但我生成的电子邮件不符合电子邮件格式。有没有办法让我的字符串触发电子邮件应用程序格式?请帮忙谢谢。