You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I am trying to use :extra_data to search multiple columns in the model. That is, I want a single 'location' input field to show autocompleted results from either the city and country attributes in a model.
Or do I need to instead overwrite the autocomplete controller method (autocomplete_organization_city)?
This seems to be a pretty common use case, would be great if it was supported...
Thanks
The text was updated successfully, but these errors were encountered:
Hi there, I am trying to use :extra_data to search multiple columns in the model. That is, I want a single 'location' input field to show autocompleted results from either the city and country attributes in a model.
The README explains that extra_data is used to 'Passing an array of attributes/column names to this option will fetch and return the specified data'. It's not clear to me if this functions as a solution for me. However, I see this accepted answer on stack: https://stackoverflow.com/questions/30790421/rails-jquery-autocomplete-search-multiple-attributes.
Am I able to use extra_data in this way?
organizations_controller
autocomplete :organization, :city, full: true, limit: 5, :extra_data => [:country]
organization view
= autocomplete_field_tag 'location', '', autocomplete_organization_city_organizations_path
Or do I need to instead overwrite the autocomplete controller method (autocomplete_organization_city)?
This seems to be a pretty common use case, would be great if it was supported...
Thanks
The text was updated successfully, but these errors were encountered: