Module: ActionMailerWithRequest::DefaultUrlOptionsOverride
- Defined in:
- lib/actionmailer_with_request.rb
Instance Method Summary collapse
-
#default_url_options(*args) ⇒ Object
Extends ActionMailer#default_url_options capabilities by merging the latest request context into the default url options.
Instance Method Details
#default_url_options(*args) ⇒ Object
Extends ActionMailer#default_url_options capabilities by merging the latest request context into the default url options.
Returns the default url options Hash.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/actionmailer_with_request.rb', line 22 def (*args) defaults = {} request = Thread.current["actiondispatch.request"] if request host = request.host port = request.port protocol = request.protocol standard_port = request.standard_port defaults[:protocol] = protocol defaults[:host] = host defaults[:port] = port if port != standard_port end super.merge(defaults) end |