From 36ac675d2af5838c81afbd7c95b2e403e6366ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sat, 25 Nov 2017 11:49:01 -0500 Subject: Make form_with_generates_ids default in Rails 5.2 When the defaults being loaded are the 5.0 or 5.1 we disable generation of ids with form_with. --- railties/lib/rails/application/configuration.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 7f23203e8b..a1023e5d6e 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -72,6 +72,9 @@ module Rails self.ssl_options = { hsts: { subdomains: true } } + if respond_to?(:action_view) + action_view.form_with_generates_ids = false + end when "5.1" load_defaults "5.0" @@ -81,9 +84,7 @@ module Rails if respond_to?(:action_view) action_view.form_with_generates_remote_forms = true - action_view.form_with_generates_ids = true end - when "5.2" load_defaults "5.1" @@ -107,6 +108,10 @@ module Rails action_controller.default_protect_from_forgery = true end + if respond_to?(:action_view) + action_view.form_with_generates_remote_forms = true + action_view.form_with_generates_ids = true + end else raise "Unknown version #{target_version.to_s.inspect}" end -- cgit v1.2.3