diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 10:50:59 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 10:50:59 +0000 |
commit | ffd93a84ff345192db71704572bada99e63f161b (patch) | |
tree | 984109f9da1f1add852020be419755df02801757 /actionpack/lib/action_view | |
parent | c8d68dfed3c83f3b5c32dc58d797254b219744b9 (diff) | |
download | rails-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/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 6 |
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 |