Skip to content

Instantly share code, notes, and snippets.

@djpate
Forked from anonymous/gist:1228912
Created September 20, 2011 11:43
Show Gist options
  • Save djpate/1228917 to your computer and use it in GitHub Desktop.
Save djpate/1228917 to your computer and use it in GitHub Desktop.
$( "#user" ).autocomplete({
source: {{routes.url_to('users', 'autocomplete')}},
minLength: 2,
select: function( event, ui ) {
$('#input_user').val(ui.item.value);
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment