Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not possibe to use the computed values #5

Open
dima4p opened this issue Feb 19, 2010 · 0 comments
Open

It is not possibe to use the computed values #5

dima4p opened this issue Feb 19, 2010 · 0 comments

Comments

@dima4p
Copy link

dima4p commented Feb 19, 2010

@@ -93,11 +93,11 @@ module AutoCompleteMacrosHelper
   #
   # The auto_complete_result can of course also be called from a view belonging to the 
   # auto_complete action if you need to decorate it further.
   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])) }
+    items = entries.map { |entry| content_tag("li", phrase ? highlight(entry.send(field), phrase) : h(entry.send(field))) }
     content_tag("ul", items.uniq)
   end

Wrapper for text_field with added AJAX autocompletion functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant