所以基本上我在实际尝试在生产中重置用户密码时感到很挣扎。虽然邮件实际上已发送,并且它适用于开发,但在生产时,链接生成如下:
http://myapp.com%20/users/password/edit?reset_password_token=XXXXXXXXXXXXXXX
实际问题是正在生成的%20,因为如果我将其取出,我会被重定向到我正在寻找的页面。那我怎么能摆脱那个%20?
这是我的开发和生产rbs
发展
config.cache_classes = false
config.whiny_nils = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
:port => '587',
:address => 'smtp.mandrillapp.com',
:user_name => ENV["SMTP_USER"],
:password => ENV["SMTP_PWD"],
:domain => 'myapp.com',
:authentication => :plain
}
config.active_support.deprecation = :log
config.action_dispatch.best_standards_support = :builtin
config.active_record.mass_assignment_sanitizer = :strict
config.active_record.auto_explain_threshold_in_seconds = 0.5
config.assets.compress = false
config.assets.debug = true
生产
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => 'myapp.com'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
:port => '587',
:address => 'smtp.mandrillapp.com',
:user_name => ENV["SMTP_USER"],
:password => ENV["SMTP_PWD"],
:domain => 'myapp.com',
:authentication => :plain
}