aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2005-10-14 02:07:51 +0000
committerMichael Koziarski <michael@koziarski.com>2005-10-14 02:07:51 +0000
commit59709d9188b7afff3ee53a4a20b9e40a7699e298 (patch)
tree2a60478c18cad20cea25586b732a74855a9b76e3 /actionpack/lib/action_view
parentacb80e3d0e96725fffad7caa42cc33281714450a (diff)
downloadrails-59709d9188b7afff3ee53a4a20b9e40a7699e298.tar.gz
rails-59709d9188b7afff3ee53a4a20b9e40a7699e298.tar.bz2
rails-59709d9188b7afff3ee53a4a20b9e40a7699e298.zip
Ensure radio_button works as expected with values other than strings.
Thanks to: * grant.mcinnes@utoronto.ca * rails@jeffcole.net git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2573 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 95132d130b..eadaeaea00 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -174,7 +174,7 @@ module ActionView
options = DEFAULT_RADIO_OPTIONS.merge(options.stringify_keys)
options["type"] = "radio"
options["value"] = tag_value
- options["checked"] = "checked" if value == tag_value
+ options["checked"] = "checked" if value.to_s == tag_value.to_s
pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase
options["id"] = @auto_index ?
"#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" :