1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
David Heinemeier Hansson 2004-12-08 10:50:59 +00:00
parent c8d68dfed3
commit ffd93a84ff

View file

@ -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
end