mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make form_with_generates_ids default value to be false
This will keep the behavior of an application with the defaults of a 4.2 or 5.0 application behaving the same when upgrading to 5.2.
This commit is contained in:
parent
a64be3ea6f
commit
21cd5b3031
3 changed files with 10 additions and 5 deletions
|
@ -478,7 +478,7 @@ module ActionView
|
||||||
|
|
||||||
mattr_accessor :form_with_generates_remote_forms, default: true
|
mattr_accessor :form_with_generates_remote_forms, default: true
|
||||||
|
|
||||||
mattr_accessor :form_with_generates_ids, default: true
|
mattr_accessor :form_with_generates_ids, default: false
|
||||||
|
|
||||||
# Creates a form tag based on mixing URLs, scopes, or models.
|
# Creates a form tag based on mixing URLs, scopes, or models.
|
||||||
#
|
#
|
||||||
|
|
|
@ -5,6 +5,15 @@ require "controller/fake_models"
|
||||||
|
|
||||||
class FormWithTest < ActionView::TestCase
|
class FormWithTest < ActionView::TestCase
|
||||||
include RenderERBUtils
|
include RenderERBUtils
|
||||||
|
|
||||||
|
setup do
|
||||||
|
@old_value = ActionView::Helpers::FormHelper.form_with_generates_ids
|
||||||
|
ActionView::Helpers::FormHelper.form_with_generates_ids = true
|
||||||
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
ActionView::Helpers::FormHelper.form_with_generates_ids = @old_value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class FormWithActsLikeFormTagTest < FormWithTest
|
class FormWithActsLikeFormTagTest < FormWithTest
|
||||||
|
|
|
@ -73,10 +73,6 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
self.ssl_options = { hsts: { subdomains: true } }
|
self.ssl_options = { hsts: { subdomains: true } }
|
||||||
|
|
||||||
if respond_to?(:action_view)
|
|
||||||
action_view.form_with_generates_ids = false
|
|
||||||
end
|
|
||||||
when "5.1"
|
when "5.1"
|
||||||
load_defaults "5.0"
|
load_defaults "5.0"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue