你好,
我在生产应用程序中打印命名路由的 URL 时遇到问题。在我的一个电子邮件模板(电子邮件注册确认)中,我试图附加确认 url。这是模板片段
<p>Welcome to example. To complete your registration, please click on the link below or paste it into a browser to confirm your e-mail address. You will then be redirected to example.com login page </p>
<p> <%= confirmlogin_url(:id => @user.id, :msg => @user.verification_code )%> </p>
我的命名路线看起来像这样
match 'confirm_registration' => 'users#confirm_user' ,:as=> :confirmlogin
它在开发环境中运行良好,并且电子邮件以这样的确认 url 呈现
Welcome to example. To complete your
registration, please click on the link
below or paste it into a browser to
confirm your e-mail address. You will
then be redirected to example.com.
http://localhost:3000/confirm_registration?id=16&msg=7fe548db-ab7d-3a8d-a87f-94ba89b0c29b
但在生产环境中,我希望将 localhost:3000 替换为我的实际域名。但它仍然打印本地主机 url..
我只是想确认这是预期的行为..?