README outdated and referring to the wrong gem
Closed this issue · 9 comments
There are several mistakes in the README. I suppose it's outdated but it should be fixed because the errors we run into might discourage people from using this gem.
- The single most important one is that
gem 'gmaps-autocomplete-rails
isn't loading your gem. We must refer to your repository as in
gem 'gmaps-autocomplete-rails', github: "kristianmandrup/gmaps-autocomplete-rails"
- jquery-ui-rails reached version 5.0.0 and must be loaded with
//= require jquery-ui
instead of require jquery.ui.all
- This must be added to include the stylesheets for the autocompleter
app/assets/stylesheets/application.css
*= require jquery-ui
As a side note, I had to //= require gmaps-auto-complete.js
with the .js suffix because I disabled coffescript in the Gemfile.
Actually, both gems are yours but the default version is outdated and not in sync with the README.
To help you debug the problem, the gemspec of the outdated gem is https://gist.github.com/pmontrasio/aeb15a618b5f288451bc
The gemspec of the gem I get when including the github option is https://gist.github.com/pmontrasio/2b69a7cd37d35740ef1e
Finally, I noticed this message from bundle with the gem that works
gmaps-autocomplete-rails at /home/me/.rvm/gems/ruby-2.1.2@forever/bundler/gems/gmaps-autocomplete-rails-f9c604cf9d27 did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
["spec/index.html", "spec/init.js", "vendor/assets/javascripts/gmaps-autocomplete.js"] are not files
Thanks. I'm excluding the 3 non-existing files from the gemspec and releasing a new official version ASAP.
Pushed version 0.1.4. Hope it resolves most of the issues (I'm not using Rails at this point)
Successfully registered gem: gmaps-autocomplete-rails (0.1.4)
Fixed, closing.
Thanks!
Great! You are most welcome to fork this gem and take over from where I have left off.
Would be nice to make it more "flexible", f.ex not to be coupled to jquery-ui and have a better class structure instead of the current flat one. Cheers!
You're too kind to me. I don't make promises but I just I forked it to add a 3rd argument to updateUI, to pass the full geocoder response. Thank you for all the good work!
I would recommend the following redesign...
Split up the class into these classes:
- GmapsConfigurator
- GmapsGeocoder
- GmapsUI
- GmapsErrorHandler
Please spend 1-2 hours and see what you come up with ;) Also add a test suite (TDD).
Cheers!
Checkout this branch:
https://github.com/kristianmandrup/gmaps-autocomplete-rails/tree/refactor
You are most welcome to work on it if you have time... :)