Browse files

Allow symbols as name

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7151 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8a207f6 commit 4d0780e9c796aab7c70dc138fea4374eb73b16cf @dhh dhh committed Jun 28, 2007
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/form_tag_helper.rb
View
2 actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -289,7 +289,7 @@ def check_box_tag(name, value = "1", checked = false, options = {})
# # => <input checked="checked" class="color_input" id="color_green" name="color" type="radio" value="green" />
def radio_button_tag(name, value, checked = false, options = {})
pretty_tag_value = value.to_s.gsub(/\s/, "_").gsub(/(?!-)\W/, "").downcase
- pretty_name = name.gsub(/\[/, "_").gsub(/\]/, "")
+ pretty_name = name.to_s.gsub(/\[/, "_").gsub(/\]/, "")
html_options = { "type" => "radio", "name" => name, "id" => "#{pretty_name}_#{pretty_tag_value}", "value" => value }.update(options.stringify_keys)
html_options["checked"] = "checked" if checked
tag :input, html_options

0 comments on commit 4d0780e

Please sign in to comment.