Module: SimpleForm::Inputs::Autocomplete
- Included in:
- AutocompleteCollectionInput, AutocompleteInput
- Defined in:
- lib/rails-autocomplete/simple_form_plugin.rb
Instance Method Summary collapse
-
#rewrite_autocomplete_option ⇒ Object
Method used to rename the autocomplete key to a more standard data-autocomplete key.
Instance Method Details
#rewrite_autocomplete_option ⇒ Object
Method used to rename the autocomplete key to a more standard data-autocomplete key
8 9 10 11 12 13 14 |
# File 'lib/rails-autocomplete/simple_form_plugin.rb', line 8 def rewrite_autocomplete_option = {} ["data-autocomplete-fields"] = JSON.generate(.delete :fields) if [:fields] ["data-update-elements"] = JSON.generate(.delete :update_elements) if [:update_elements] ["data-id-element"] = .delete :id_element if [:id_element] .merge end |