Forum: Ruby on Rails request.env availability

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
surge (Guest)
on 2007-06-16 17:13
(Received via mailing list)
Hello everybody,

My application will run on different machines with different host
names. In most of my emails I have to include a link with the name of
the server the email is coming from. So, I decided to use the
request.env hash to get the server name. But request.env is not
available in ActionMailer. So, I have to pass that variable to each
mailing method from the controller, which doesn't look too good.

Is there a better way? Can I hardcode the name of the server somewhere
in the configuration (environment.rb ?) and thus make it available
everywhere?

Thanks,
Sergei
This topic is locked and can not be replied to.