apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Gmaps4rails not showing #357

Closed hkairi closed 11 years ago

hkairi commented 11 years ago

Hi,

i am facing this issue : Gmaps 4 rails not showing except when i refresh ! I am using Rails4

davidakachaos commented 11 years ago

:+1: Here neither....

taylorbrooks commented 11 years ago

Same. I've tried using Google Maps outside of the gem and it still doesn't work. So I think it's a problem with Rails 4 or my JS.

hkairi commented 11 years ago

I think it is a problem caused by TurboLinks

Jngai commented 11 years ago

Hey my map is not showing as well..... using rails 4 here, maybe I have a js problem as well ?

nordbit commented 11 years ago

Turbolinks, wiselinks, JQueryMobile - any engine based on ajax call. Look here: https://github.com/apneadiving/Google-Maps-for-Rails/pull/328 Issue is described here: http://stackoverflow.com/questions/13807686/gmaps4rails-and-turbolinks-not-loading-without-full-page-refresh Quick and dirty solution - disable Turbolink with "data-no-turbolink" for specified pages/links It is not really gmaps4rails issue, but google api loaded in ajax call.

aweis89 commented 11 years ago

Using rails 4.0, and I can't get the map to work at all. Any suggestions?

hennzen commented 11 years ago

Using "data-no-turbolink" solved this for me in Rails 4: <%= link_to "Page with gmap", foo_path(foo), 'data-no-turbolink' => true %>

hkairi commented 11 years ago

Thans @hennzen

I tried it with the option "data-no-turbolink" set to false ... and it worked !