Closed jonathanng closed 10 years ago
I had this before. You can set data_no_turbolinks => false in your 'back' and redirect link options
I was kind of hoping to use Turbolinks.
It was working with this fork before:
There is nothing more to do with gmaps4rails than with other js resources.
I dont know turbolinks (and I wont dig, it's a terrible idea... Ok it's not the debate).
Basically insert google scripts in all your pages, you'll be fine.
That works. Thanks!
Is this what you mean by "insert google scripts in all your pages"?
app/views/layouts/application.html.erb
<!DOCTYPE html>
<html lang="en">
<%= render partial: 'layouts/html_head' %>
<body>
<div class="container">
<%= render partial: 'layouts/navbar' %>
<%= yield %>
</div><!-- /.container -->
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<script src="//maps.google.com/maps/api/js?v=3.14&sensor=false&libraries=geometry" type="text/javascript"></script>
<script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.1.2/src/markerclusterer_packed.js" type="text/javascript"></script>
</body>
</html>
app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require turbolinks
//= require bootstrap
//= require lodash.underscore
//= require gmaps/google
//= require_tree .
Yes.
I'm using Turbolinks, which is standard for Rails 4.
When I do a full reload refresh, the page works fine, but if I'm coming from another page, I'm getting the the dreaded "Uncaught ReferenceError: google is not defined".
On the bottom of my show.html.haml, I have:
Wouldn't it be easier just to add these javascript files to the asset pipeline like we do with gmaps/google?