vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb
# Use this method in your view to generate a return for the AJAX autocomplete requests.
#
# Example action:
#
#   def auto_complete_for_item_title
#     @items = Item.find(:all, 
#       :conditions => [ 'LOWER(description) LIKE ?', 
#       '%' + request.raw_post.downcase + '%' ])
#     render :inline => "<%= auto_complete_result(@items, 'description') %>"
#   end
#
# 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.
Use this method in your view to generate a return for the AJAX autocomplete requests.
Example action.



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.
Use this method in your view to generate a return for the AJAX autocomplete requests . Example action . 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])) }
    content_tag("ul", items.uniq)
  end
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 ) end
Use this method in your view to generate a return for the AJAX autocomplete requests.
Use this method in your view to generate a return for the AJAX autocomplete requests .
entries
<not_specific>
field
<not_specific>
phrase
<not_specific>