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
Markers returning as Null #487
Comments
not sure I understand why you have You dont need to rely on data available only on page load, you can have:
Seems very weird to have dynamic data in a js.erb: its rendered once, load your dynamic data with ajax |
Wouldn't all this run on site load however, even with ajax? I don't see how I get away from The search is what determines what markers are going to be available. For example, in my Database I have Venues which are in London and others in New York. If the user searches for USA, the controller returns the geolocation of those Venues and creates the markers This is my controller if that clears things up:
|
When I try to add the
@hash
to my javascript, it renders:I'm using maps with a search bar which is on every page. The search bar uses Google Places and sends the user to the Search Controller which is where I create the
@hash
. It seems like the JS in the ReadMe is created on site load, therefore the Markers are null.Right now I have all the JS in a Maps.js.erb file. Does the script need to be in the View so it's rendered at the same time as the partial or is there another workaround?
The text was updated successfully, but these errors were encountered: