Skip to content

Instantly share code, notes, and snippets.

@testflyjets
Created February 27, 2014 04:20
Show Gist options
  • Save testflyjets/9244335 to your computer and use it in GitHub Desktop.
Save testflyjets/9244335 to your computer and use it in GitHub Desktop.
$(document).ready ->
$('#search_member').autocomplete(
source: "/autocomplete_search"
minLength: 2
select: (event,ui) ->
$("#search_id").val(ui.item.id)
false
)
.data('autocomplete')?._renderItem = (ul, item) ->
$("<li class='autocomplete-item'></li>")
.data("item.autocomplete", item)
.append("<a href='#'>" + item.name + "</a>")
.appendTo(ul)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment