Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9088

Show
Ignore:
Timestamp:
03/24/08 21:32:50 (5 months ago)
Author:
david
Message:

Fixed that FormHelper#radio_button would produce invalid ids (closes #11298) [harlancrystal]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r9087 r9088  
    11*SVN* 
     2 
     3* Fixed that FormHelper#radio_button would produce invalid ids #11298 [harlancrystal] 
    24 
    35* Added :confirm option to submit_tag #11415 [miloops] 
  • trunk/actionpack/lib/action_view/helpers/form_helper.rb

    r9024 r9088  
    499499        pretty_tag_value    = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase 
    500500        options["id"]     ||= defined?(@auto_index) ? 
    501           "#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" : 
    502           "#{@object_name}_#{@method_name}_#{pretty_tag_value}" 
     501          "#{tag_id_with_index(@auto_index)}_#{pretty_tag_value}" : 
     502          "#{tag_id}_#{pretty_tag_value}" 
    503503        add_default_name_and_id(options) 
    504504        tag("input", options) 
  • trunk/actionpack/test/template/form_helper_test.rb

    r8786 r9088  
    188188      radio_button("post", "title", "Goodbye World") 
    189189    ) 
     190    assert_dom_equal('<input id="item_subobject_title_inside_world" name="item[subobject][title]" type="radio" value="inside world"/>', 
     191      radio_button("item[subobject]", "title", "inside world") 
     192    ) 
    190193  end 
    191194