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

Ticket #4735 (new defect)

Opened 3 years ago

Last modified 3 years ago

[PATCH] form_helper radio_button does not respect the index option in html tag id attribute

Reported by: charles.dupont@vanderbilt.edu Assigned to: David
Priority: normal Milestone:
Component: ActionPack Version: 1.1.1
Severity: normal Keywords: radio_button form_helper tiny
Cc:

Description

The radio_button helper method in form_helper.rb does not create HTML tag ids that use the index option.

radio_button("post", "title", "Foo Bar", {"index" => 1})

becomes

<input id="post_title_foo_bar" name="post[1][title]" type="radio" value="Foo Bar" />

not

<input id="post_1_title_foo_bar" name="post[1][title]" type="radio" value="Foo Bar" />

This patch fixes the problem and possibly makes it more DRY.

Attachments

radio_button_index_option_test_patch.diff (0.7 kB) - added by charles.dupont@vanderbilt.edu on 04/14/06 13:43:28.
Unit tests for radio_button using index option.
radio_button_respects_index_option_patch.diff (0.9 kB) - added by charles.dupont@vanderbilt.edu on 04/14/06 13:44:13.
Fix for radio_button index option
form_helper_method_index_test_patch.diff (2.3 kB) - added by charles.dupont@vanderbilt.edu on 04/14/06 14:26:50.
Index option tests for all form_helper methods
form_helper_method_index_test_patch.2.diff (2.3 kB) - added by charles.dupont@vanderbilt.edu on 04/14/06 14:32:06.
Index option tests for all form_helper methods; now with better variable name
form_helper_method_index_test_patch.3.diff (2.3 kB) - added by charles.dupont@vanderbilt.edu on 04/14/06 14:35:22.
Index option tests for all form_helper methods; now from a sane root dir. admin please condense these 3 attachments to just the most recent.

Change History

04/14/06 13:43:28 changed by charles.dupont@vanderbilt.edu

  • attachment radio_button_index_option_test_patch.diff added.

Unit tests for radio_button using index option.

04/14/06 13:44:13 changed by charles.dupont@vanderbilt.edu

  • attachment radio_button_respects_index_option_patch.diff added.

Fix for radio_button index option

04/14/06 14:26:50 changed by charles.dupont@vanderbilt.edu

  • attachment form_helper_method_index_test_patch.diff added.

Index option tests for all form_helper methods

04/14/06 14:32:06 changed by charles.dupont@vanderbilt.edu

  • attachment form_helper_method_index_test_patch.2.diff added.

Index option tests for all form_helper methods; now with better variable name

04/14/06 14:35:22 changed by charles.dupont@vanderbilt.edu

  • attachment form_helper_method_index_test_patch.3.diff added.

Index option tests for all form_helper methods; now from a sane root dir. admin please condense these 3 attachments to just the most recent.

05/17/06 13:21:31 changed by charles.dupont@vanderbilt.edu

  • keywords changed from radio_button form_helper to radio_button form_helper tiny.
  • summary changed from [PATCH] form_helper radio_button does not respect the index option in id to [PATCH] form_helper radio_button does not respect the index option in html tag id attribute.