diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-11-25 11:49:01 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-11-25 11:56:31 -0500 |
commit | 36ac675d2af5838c81afbd7c95b2e403e6366ba5 (patch) | |
tree | 8530dd4bbac60073411ad227d40ea4a2f1a934a4 /railties | |
parent | 260d6f112a0ffdbe03e6f5051504cb441c1e94cd (diff) | |
download | rails-36ac675d2af5838c81afbd7c95b2e403e6366ba5.tar.gz rails-36ac675d2af5838c81afbd7c95b2e403e6366ba5.tar.bz2 rails-36ac675d2af5838c81afbd7c95b2e403e6366ba5.zip |
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.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 9 |
1 files changed, 7 insertions, 2 deletions
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 |