Wednesday, April 9, 2008

Missing host to link to! Please provide :host parameter or set default_url_options[:host]

When using a link_to or url_for in an ActionMailer and you need to set the host.

In production.rb or the appropriate env config file.

config.action_mailer.default_url_options = { :host => 'www.example.com' }

4 comments:

Phiala said...

Good for people to know.

Anonymous said...

thanks!

Ryan said...

Works in Rails 2.3.5

Thanks!

Anonymous said...

Thanks, I needed this in my test.rb environment file to get my specs to work.