Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with bootstrap? #22

Open
chesterl opened this issue Dec 14, 2014 · 5 comments
Open

Working with bootstrap? #22

chesterl opened this issue Dec 14, 2014 · 5 comments

Comments

@chesterl
Copy link

I want to integrate it with a bootstrap form on rails but the bootstrap appears to be interfering with adding in the JS and autocomplete. Not entirely sure where to start for trying to get the two to cooperate. Any suggestions?

@sgruhier
Copy link
Owner

I'm using it in Rails app. What interference do you have?
Could you share sample code or URL?

@chesterl
Copy link
Author

I was able to get it working by modifying it last night to this following the older version's example

var addressPicker = new AddressPicker();
$('input[name="event[location]"]').typeahead(null, {
displayKey: 'description',
source: addressPicker.ttAdapter()
});

whereas it was previously just #event_location. I thought it was grabbing it by ID. not sure if there is another way to write the above, but it does work.

@chesterl
Copy link
Author

I have a different issue now actually. When I enter the text, it pulls up the suggestions. If I select it, it fills it in, but when I click outside the text box, it disappears. This only does this in my new action not my edit. Not sure why..

in the form

<%= f.text_field :location, class: 'form-control', placeholder: 'e.g. Calgary, AB' %>

The script is written as above.

@smilansky
Copy link

Have you been able to fix this? I am getting 'undefined is not a function' whether I grab it by id or name. Anyone else have this issue with a rails app using boostrap?

@chesterl
Copy link
Author

That is a whole another issue all together then. it suggests you're not loading your library properly. Make sure Jquery is being loaded properly before you load this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants