2016-03-10 20 views
0

在我config/environment/development.rb,我有使用配置URL,而不是config.ip的

config.ip: 'http://localhost:3000' 

在我config/environment/production.rb,我有

config.ip = 'http://52.74.70.227' 

我想使用类似config.url = 'http://example.com' 因此,当有人收到
激活电子邮件链接从我的链接显示http://example.com/abc intead的http://52.74.70.227/abc

+0

请尝试这种希望它将工作。 Rails.application.routes.default_url_options [:host] ='http:// localhost:3000' –

+0

@P_M这会将我的IP更改为生产中的url – Supertracer

+0

为什么不能定义这个config.action_mailer.default_url_options = {:host =>“localhost:3000”}并在生产中config.action_mailer.default_url_options = {:host =>“example.com”} – LHH

回答

0

config/environment/development.rb de细

config.action_mailer.default_url_options = {host: "localhost:3000"} 
config/environment/production.rb

定义

config.action_mailer.default_url_options = {host: "example.com"} 

更多信息点击这里http://api.rubyonrails.org/classes/ActionMailer/Base.html

相关问题