1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove unnecessary skip_default_ids and allow_method_names_outside_object attributes of select tag in form_with

This commit is contained in:
kyuden 2017-04-24 00:09:42 +09:00
parent a6a93f9ed5
commit dc46a71e54
2 changed files with 3 additions and 1 deletions

View file

@ -149,7 +149,7 @@ module ActionView
end
value = options.fetch(:selected) { value(object) }
select = content_tag("select", add_options(option_tags, options, value), html_options)
select = content_tag("select", add_options(option_tags, options, value), html_options.except!("skip_default_ids", "allow_method_names_outside_object"))
if html_options["multiple"] && options.fetch(:include_hidden, true)
tag("input", disabled: html_options["disabled"], name: html_options["name"], type: "hidden", value: "") + select

View file

@ -302,6 +302,7 @@ class FormWithActsLikeFormForTest < FormWithTest
concat f.text_field(:title)
concat f.text_area(:body)
concat f.check_box(:secret)
concat f.select(:category, %w( animal economy sports ))
concat f.submit("Create post")
concat f.button("Create post")
concat f.button {
@ -315,6 +316,7 @@ class FormWithActsLikeFormForTest < FormWithTest
"<textarea name='post[body]'>\nBack to the hill and over it again!</textarea>" \
"<input name='post[secret]' type='hidden' value='0' />" \
"<input name='post[secret]' checked='checked' type='checkbox' value='1' />" \
"<select name='post[category]'><option value='animal'>animal</option>\n<option value='economy'>economy</option>\n<option value='sports'>sports</option></select>" \
"<input name='commit' data-disable-with='Create post' type='submit' value='Create post' />" \
"<button name='button' type='submit'>Create post</button>" \
"<button name='button' type='submit'><span>Create post</span></button>"