Internals: This gem patches the
get_autocomplete_items method (provided by rails3-jquery-autocomplete) so it works with translated model columns.
rails3-jquery-autocomplete 1.0 and globalize3 0.3 are supported.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install globalize3-jquery-autocomplete
You don't need any additional configuration. As soon as a column is translated, autocomplete will automatically be in context of the current locale.
Example (in your controller):
# query for matches in the current locale (given the 'name' column of your Brand model is translated): autocomplete :brand, :name
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request