Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'leandroo/master'
  • Loading branch information
David Padilla committed Aug 8, 2011
2 parents db65523 + 5c2cd42 commit abbe5dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.markdown
Expand Up @@ -216,7 +216,10 @@ The previous example would fetch the extra attribute slogan and update jQuery('#

A javascript event named *railsAutocomplete.select* is fired on the input field when a value is selected from the autocomplete drop down. If you need to do something more complex than update fields with data, you can hook into this event, like so:

$('#my_autocomplete_field').bind('railsAutocomplete.select', function(){ /* Do something here */});
$('#my_autocomplete_field').bind('railsAutocomplete.select', function(event, data){
/* Do something here */
alert(data.item.id);
});

## Formtastic

Expand Down
Expand Up @@ -103,7 +103,7 @@ $(document).ready(function(){
$(this).unbind('keyup.clearId');
}
});
$(this).trigger('railsAutocomplete.select');
$(this).trigger('railsAutocomplete.select', ui);

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/templates/autocomplete-rails.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit abbe5dc

Please sign in to comment.