读书人

Missing host to link to

发布时间: 2012-10-25 10:58:57 作者: rapoo

Missing host to link to!

Problem:
Missing host to link to! Please provide :host parameter or set default_url_options[:host] when sending emails.

Solution:
You can pass host parameter to url functions, but it’s cleaner to configure it with a before_filter globally in your application_controller.rb:

?

  # application_controller.rb  before_filter :mailer_set_url_options   ...   def mailer_set_url_options    ActionMailer::Base.default_url_options[:host] = request.host_with_port  end
?

读书人网 >操作系统

热点推荐