Open Jirka1111 opened 8 years ago
Hello, I am using this plugin in Rails but still have a problem with error in title.
Definition of script: script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&sensor=false
Input text field: <%= f.text_field :place, id: "cities", class: "form-control cities", type: "text" %>
Javascript load:
$("cities").geocomplete(); // Option 1: Call on element. $.fn.geocomplete("cities"); // Option 2: Pass element as argument.
I have done everything as described on GitHub but still cannot get it works. If I use $("#cities").geocomplete(); the error is the same.
Please, can somebody help me?
So the solution was pretty simply (thanks Sravan from SO). First row is enough:
$("cities").geocomplete();
But be aware, this jQuery gem doesn't work in Bootstrap modal.
Hello, I am using this plugin in Rails but still have a problem with error in title.
Definition of script: script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places&sensor=false
Input text field: <%= f.text_field :place, id: "cities", class: "form-control cities", type: "text" %>
Javascript load:
$("cities").geocomplete(); // Option 1: Call on element. $.fn.geocomplete("cities"); // Option 2: Pass element as argument.
I have done everything as described on GitHub but still cannot get it works. If I use $("#cities").geocomplete(); the error is the same.
Please, can somebody help me?