mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Set host for ActionMailer instances.
Fixes #256. I'm not happy with this, but at least it works. For now.
This commit is contained in:
parent
9a800989a2
commit
abcb33fdd8
1 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,11 @@ module Draper
|
||||||
|
|
||||||
def self.build_view_context
|
def self.build_view_context
|
||||||
current_controller.view_context.tap do |context|
|
current_controller.view_context.tap do |context|
|
||||||
|
context.instance_eval do
|
||||||
|
def url_options
|
||||||
|
ActionMailer::Base.default_url_options
|
||||||
|
end
|
||||||
|
end unless context.request
|
||||||
if defined?(ActionController::TestRequest)
|
if defined?(ActionController::TestRequest)
|
||||||
context.controller.request ||= ActionController::TestRequest.new
|
context.controller.request ||= ActionController::TestRequest.new
|
||||||
context.request ||= context.controller.request
|
context.request ||= context.controller.request
|
||||||
|
|
Loading…
Reference in a new issue