Closed diderevyagin closed 10 years ago
Hi. Simple workground: delete:
controller do
autocomplete :driver_transaction, :tran_id
end
and define:
member_action :autocomplete_driver_transaction_tran_id do
dt = DriverTransaction.any_of({:tran_id => Regexp.new(".*#{params[:term]}.*")})
dt_arr = []
dt.each { |cur_dt| dt_arr << cur_dt.tran_id }
render :json => dt_arr
end
This sounds like you were able to resolve your own issue?
This gave me a problem when I had a mongoid model that subclassed another mongoid model. The "get_prefix" method that is defined in the autocomplete method in rails3-jquery-autocomplete / lib / rails3-jquery-autocomplete / autocomplete.rb checks the superclass of the object's class and mandates it be "Object" in order for the prefix to be correctly selected. So if you subclass you break this.
The only way I've been found to workaround this is to monkey patch the autocomplete method to return "mongoid" in the get_prefix definition.
Hi. Integrating rails3-jquery-autocomplete with mongoid and activeadmin Encountered an error 'NoMethodError (undefined method `table_name' for XXX:Class)'
XXX - model
Model:
activeadmin:
On changed event send to server call:
On server has error:
any ideas and tips - I will be very grateful