mirror of
https://github.com/github/rails.git
synced 2026-01-29 16:28:09 -05:00
Fixed that FormHelper#radio_button would produce invalid ids (closes #11298) [harlancrystal]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Fixed that FormHelper#radio_button would produce invalid ids #11298 [harlancrystal]
|
||||
|
||||
* Added :confirm option to submit_tag #11415 [miloops]
|
||||
|
||||
* Fixed NumberHelper#number_with_precision to properly round in a way that works equally on Mac, Windows, Linux (closes #11409, #8275, #10090, #8027) [zhangyuanyi]
|
||||
|
||||
@@ -498,8 +498,8 @@ module ActionView
|
||||
options["checked"] = "checked" if checked
|
||||
pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase
|
||||
options["id"] ||= defined?(@auto_index) ?
|
||||
"#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" :
|
||||
"#{@object_name}_#{@method_name}_#{pretty_tag_value}"
|
||||
"#{tag_id_with_index(@auto_index)}_#{pretty_tag_value}" :
|
||||
"#{tag_id}_#{pretty_tag_value}"
|
||||
add_default_name_and_id(options)
|
||||
tag("input", options)
|
||||
end
|
||||
|
||||
@@ -187,6 +187,9 @@ class FormHelperTest < Test::Unit::TestCase
|
||||
assert_dom_equal('<input id="post_title_goodbye_world" name="post[title]" type="radio" value="Goodbye World" />',
|
||||
radio_button("post", "title", "Goodbye World")
|
||||
)
|
||||
assert_dom_equal('<input id="item_subobject_title_inside_world" name="item[subobject][title]" type="radio" value="inside world"/>',
|
||||
radio_button("item[subobject]", "title", "inside world")
|
||||
)
|
||||
end
|
||||
|
||||
def test_radio_button_is_checked_with_integers
|
||||
|
||||
Reference in New Issue
Block a user