<% options, attrs = attributes.partition_hash(['disabled', 'appendTo', 'autoFocus', 'delay', 'minLength', 'position', 'source']) events, html_attrs = attrs.partition_hash(['create', 'search', 'open', 'focus', 'select', 'close', 'change']) options["source"] ||= begin complete_target = this_field_reflection.klass complete_target.limit(5000).*.send(complete_target.name_attribute) end html_attrs["name"] ||= param_name_for_this html_attrs["value"] ||= name(:no_wrapper => true, :if_present => true) if(html_attrs["value"].empty?) add_classes!(html_attrs, "nil-value") html_attrs["value"] = nil_value end add_data_rapid!(html_attrs, "autocomplete", :options => options, :events => events) %>