aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-08 10:50:59 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-08 10:50:59 +0000
commitffd93a84ff345192db71704572bada99e63f161b (patch)
tree984109f9da1f1add852020be419755df02801757 /actionpack
parentc8d68dfed3c83f3b5c32dc58d797254b219744b9 (diff)
downloadrails-ffd93a84ff345192db71704572bada99e63f161b.tar.gz
rails-ffd93a84ff345192db71704572bada99e63f161b.tar.bz2
rails-ffd93a84ff345192db71704572bada99e63f161b.zip
Fixed to_input_field_tag so it no longer explicitly uses InstanceTag.value if value was specified in the options hash [evl]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@81 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 389aa302a9..f64965bda1 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -117,7 +117,9 @@ module ActionView
def to_input_field_tag(field_type, options = {})
html_options = DEFAULT_FIELD_OPTIONS.merge(options)
html_options.merge!({ "size" => options["maxlength"]}) if options["maxlength"] && !options["size"]
- html_options.merge!({ "type" => field_type, "value" => value.to_s })
+ html_options.delete("size") if field_type == "hidden"
+ html_options.merge!({ "type" => field_type})
+ html_options.merge!({ "value" => value.to_s }) unless options["value"]
add_default_name_and_id(html_options)
tag("input", html_options)
end
@@ -179,4 +181,4 @@ module ActionView
end
end
end
-end \ No newline at end of file
+end