Posts tagged: auto_complete

auto_complete problem in ruby 1.9

By , October 8, 2009 10:57 pm

Recently I upgrade my rails version from 2.3.2  to 2.3.4 and ruby version from 1.8 to 1.9 .

By changing version of ruby,  I was facing problem in auto complete functionality.

To solve the issue , I applied below patch in lib/autocomeplete_macro_helper.rb file

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.uniq.join)
end

I changed content_tag (“ul”, items.uniq) to content_tag(“ul”,items.uniq.join)

Panorama Theme by Themocracy