aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_text/engine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_text/engine.rb')
-rw-r--r--lib/active_text/engine.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/active_text/engine.rb b/lib/active_text/engine.rb
index c11bb7cce9..aac0c57881 100644
--- a/lib/active_text/engine.rb
+++ b/lib/active_text/engine.rb
@@ -32,6 +32,13 @@ module ActiveText
initializer "active_text.config" do
config.after_initialize do |app|
ActiveText.renderer ||= ApplicationController.renderer
+
+ # FIXME: ApplicationController should have a per-request specific renderer
+ # that's been set with the request.env env, and ActiveText should just piggyback off
+ # that by default rather than doing this work directly.
+ ApplicationController.before_action do
+ ActiveText.renderer = ActiveText.renderer.new(request.env)
+ end
end
end
end