From 9c326e1fdf54ff099f9f7f94a99bf25c4cf28ffb Mon Sep 17 00:00:00 2001 From: Jacopo Date: Thu, 20 Jul 2017 13:46:35 +0200 Subject: Fix ApplicationController.renderer.defaults overriding in development Previously overriding ApplicationController.renderer.defaults wasn't working effectively in development. In fact the override was unset every time the code was reloaded. The solution is to wrap the code in a `.to_prepare` block. --- .../config/initializers/application_controller_renderer.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb index 51639b67a0..89d2efab2b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb @@ -1,6 +1,8 @@ # Be sure to restart your server when you modify this file. -# ApplicationController.renderer.defaults.merge!( -# http_host: 'example.org', -# https: false -# ) +# ActiveSupport::Reloader.to_prepare do +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) +# end -- cgit v1.2.3