我正在尝试使用Ruby on Rails在我的应用程序中实现重置密码功能。我正在使用动作邮件程序向用户的电子邮件发送链接。电子邮件正在通过链接传递给用户,但是当用户点击该链接时链接完整的URL没有到来(即 - " localhost:3000 / homes / resetpass")。只有" / homes / resetpass"即将到来。请检查我的以下代码并帮助我解决此问题。
<p><%= @users.first_name %>,</p>
<p>Thank you for registering!</p>
<p>Edit Your Password <%= link_to "Click Here",homes_resetpass_path(:id => @users.id ),:host => "localhost:3000" %></p>
class UserMailer < ActionMailer::Base
default from: "rajatpradhan474@gmail.com"
def registration_confirmation(user)
@users = user
mail(:to => user.email, :subject => "Registered")
end
end
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "rajatpradhan474@gmail.com",
:password => "**********",
:authentication => "plain",
:enable_starttls_auto => true
}
ActionMailer::Base.default_url_options[:host] = "localhost:3000"