1
0
Fork 0
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:
Steve Klabnik 2012-10-08 20:54:41 -07:00
parent 9a800989a2
commit abcb33fdd8

View file

@ -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