From 46110aa689412816d077b1f248a6cdb4d9552eda Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 9 Sep 2005 07:25:58 +0000 Subject: Fixed JavascriptHelper#auto_complete_for to only include unique items #2153 [Thomas Fuchs] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/javascript_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index e6985c5eb7..90b7100dff 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -396,7 +396,7 @@ module ActionView def auto_complete_result(entries, field, phrase = nil) return unless entries items = entries.map { |entry| content_tag("li", phrase ? highlight(entry[field], phrase) : h(entry[field])) } - content_tag("ul", items) + content_tag("ul", items.uniq) end # Wrapper for text_field with added AJAX autocompletion functionality. -- cgit v1.2.3