diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:53:59 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:53:59 +0000 |
commit | 211ffd3f792d2d0823365bdb49d29b9f7ed99ca0 (patch) | |
tree | 344300740d51e6f9a47513d06460a4606a0fc188 /actionpack/lib/action_view | |
parent | 8ff92e243568a6ae72e88f48a7ae15dffaf81e57 (diff) | |
download | rails-211ffd3f792d2d0823365bdb49d29b9f7ed99ca0.tar.gz rails-211ffd3f792d2d0823365bdb49d29b9f7ed99ca0.tar.bz2 rails-211ffd3f792d2d0823365bdb49d29b9f7ed99ca0.zip |
Fixed that FormHelper#radio_button didn't respect an :id being passed in (closes #6266) [evansj]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5247 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index f9baed69a9..4bc5a8d254 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -269,9 +269,9 @@ module ActionView else checked = self.class.radio_button_checked?(value(object), tag_value) end - options["checked"] = "checked" if checked + options["checked"] = "checked" if checked pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase - options["id"] = defined?(@auto_index) ? + options["id"] ||= defined?(@auto_index) ? "#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" : "#{@object_name}_#{@method_name}_#{pretty_tag_value}" add_default_name_and_id(options) |