我是 Rails 新手,所以请像我三岁一样解释它:)
我无法让它在自动完成时触发
看法
<div class="controls">
<%= f.hidden_field :vehicle_id, :class => 'text_field', :id =>'veh_id' %>
<%= f.autocomplete_field :vehicle_reg, autocomplete_vehicle_reg_number_vehicles_path, :id_element => '#veh_id', :class => 'text_field ui-autocomplete-input', :update_elements => {} %>
</div>
爪哇
$(document).ready(function() {
console.log('Ready')
$('#veh_id').bind('insertion-callback',
function() {
$('.autocomplete').bind('railsAutocomplete.select', function(event, data){
console.log('Hello World')
});
});
});