Ruby 在Rail 3中使用action mailer时没有完整的URL?
我正在尝试使用Ruby on Rails在我的应用程序中实现重置密码功能。我正在使用action mailer发送指向用户电子邮件的链接。电子邮件通过链接发送给用户,但当用户单击该链接时,完整URL不会出现(即-“localhost:3000/homes/resetpass”)。仅“/homes/resetpass”即将到来。请检查我的以下代码并帮助我解决此问题 视图/user\u mailer/registration\u confirmation.html.erb 您需要使用而不是链接到。链接页面描述了如何以及为什么Ruby 在Rail 3中使用action mailer时没有完整的URL?,ruby,ruby-on-rails-3,email,Ruby,Ruby On Rails 3,Email,我正在尝试使用Ruby on Rails在我的应用程序中实现重置密码功能。我正在使用action mailer发送指向用户电子邮件的链接。电子邮件通过链接发送给用户,但当用户单击该链接时,完整URL不会出现(即-“localhost:3000/homes/resetpass”)。仅“/homes/resetpass”即将到来。请检查我的以下代码并帮助我解决此问题 视图/user\u mailer/registration\u confirmation.html.erb 您需要使用而不是链接到。链
<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"