this.source is not a function

this.source is not a function

I'm trying to use autocomplete in a modal, so to get it working at all I had to 

  1. jQuery(function() {
  2.   return $(this).bind("ajax:success", function() {
  3.     return jQuery(function() {
  4.       return $('#mail_recipient').autocomplete({
  5.         source: $('#mail_recipient').data('autocomplete_source')
  6.       });
  7.     });
  8.   });
  9. });
because it wouldn't bind to an ajax loaded partial form in rails.    in the form i've got:

  1. <%= f.input :recipient, data: { autocomplete_source: ['asdf', 'qwer', 'zxcv']} %>
which will be mails_path eventually.    if I put the ['asdf'] source in the jquery, it works, but otherwise i get an uncaught type error: this.source is not a function, pointing to:

  1. _search: function( value ) {
  2.       this.pending++;
  3.       this._addClass( "ui-autocomplete-loading" );
  4.       this.cancelSearch = false;

  5.       this.source( { term: value }, this._response() ); <---
  6. },
just wondering if this is the best implementation, thanks!