diff options
-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 |