Lighthouse has a new layout.
Prefer the old one? Return to the old layout,
and switch back any time from the link at the top of each page.
This project is archived and is in readonly mode.
ActionMailer URL generation uses host/port from request
#148
ActionMailer relies on the UrlWriter module to generate all of the URLs needed for links. Because UrlWriter doesn't know anything about the current request, it becomes extremely hard to make the link aware of domain information (host/port/protocol). The Rails doc examples refer to using setting default_url_options in your mailer definitions, which means that they cannot be environment aware. Another solution I've seen used is to set domain-related model variables to be used by the mailer templates.
The following patch is a (simplified) version of Nick Kallen's Retardase Inhibitor, with his blessings. Check this link out for more details:
I don't like the way the patch does UrlWriter.set_default_url_options_from_request(request). We've been trying to remove such changes which requires a mutex around dispatching requests.