aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2017-07-20 13:46:35 +0200
committerJacopo <beschi.jacopo@gmail.com>2017-07-20 15:31:32 +0200
commit9c326e1fdf54ff099f9f7f94a99bf25c4cf28ffb (patch)
treef89707561486ec47975ec57474de8d741b48739a
parentdf94b863c2ff8f1bcf12e36ed8fc1419292668e7 (diff)
downloadrails-9c326e1fdf54ff099f9f7f94a99bf25c4cf28ffb.tar.gz
rails-9c326e1fdf54ff099f9f7f94a99bf25c4cf28ffb.tar.bz2
rails-9c326e1fdf54ff099f9f7f94a99bf25c4cf28ffb.zip
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.
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb10
1 files 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