現在的代碼只能發送郵件,我想點擊發送出去郵件的鏈接的時候再回到程序當中有什麽好的建議嗎,發送出去的鏈接應該怎麽填寫我也不是很清楚。
發送郵件的代碼
def temporary
if request.post?
@user = Client.new
@user.dp_no = @user.token
@user.client_adress = params[:email]
@user.update_date = Time.new
@user.create_date = Time.new
@user.del_flg = 1
@user.save
MailVerifyMailer.welcome_email(@user).deliver_now
end
end
想點擊郵件回到的方法
def verification
@user = Client.find_by(dp_no: value)
update_params = {
"del_flg" => false,
"update_date" => Time.new
}
@user.update(update_params)
flash[:success] = "Your account is now activated."
redirect_to '/index'
end
郵件模板
<h3>Welcome to daihatsu-member auth : <%= @user.client_adress %></h3>
<p>
You have successfully signed up to daihatsu-wifi
your username is: <%= @user.client_adress%><br>
your token is:<%= @user.dp_no%><br>
</p>
<p>
To login to the site, please click this link : <%= link_to "here", "http://0.0.0.0:3000/activations/#{@user.dp_no}", method: :post %>
</p>
<p>Thanks for joining and have a great day!</p>
我想詢問一下怎麽能回到 verification 方法 模板裏的 url 應該怎麽填寫 感謝